Time complexcity of Algorithams Big O
Please friends to contribute questions of company interviews you attended mail us cinterviews.blogspot.com@gmail.com it will be useful for our job search community.www.cinterviews.com appreciates your contribution
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]
Please friends to contribute questions of company interviews you attended mail us cinterviews.blogspot.com@gmail.com it will be useful for our job search community.www.cinterviews.com appreciates your contribution
No comments:
Post a Comment