Example & Tutorial understanding programming in easy ways.

List the time complexity of different searching algorithm .

Time Complexity of Linear Search:
Linear search: we search each and every element of sequence until we find them.
Worst case time complexity : O(n)
Best case Time complexity : O(1)

Time complexity Of binary search:
Binary Search: we perform searching on sorted array.
Worst case time complexity : O(logn)
Best case time complexity : O(1)

Time complexity of Hashing :
Basically, Hashing is the powerful tool that are used for searching because Hashing perform searching in constant time. i.e., O(1)




Read More →