Showing posts with label Omega Time complexity. Show all posts
Showing posts with label Omega Time complexity. Show all posts

Thursday, February 12, 2009

Time complexity - Omega of data structures

a) 2-4 tree - O(logn) [Omega logarithmic n]

Time complexity - Omega of algorithms

a) if statement - O(n) [Omega times n]
b) for loop - O(n) [Omega times n]
c) for loop with a for loop - O(n*n) [Omega times n squared]
d) for loop within a if loop, this if loop is within a for loop - O(n + n*n) [n plus n squared omega]
e) while loop - O(n) [Omega times n]
f) MergeSort - O(nlogn) [Omega n time logarithmic n]
g) HeapSort - O(nlogn) [Omega n time logarithmic n]
h) KMP algorithm - O(m+n) [m plus n omega]