Complexity of searching algorithm by R4R Team

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)




Leave a Comment:
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!