Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Explain difference between Sequential Search and Binary Search.

  Shared By: Eva Hughes    Date: Aug 21    Category: C++ Programming    Views: 7225

Answer:

Sequential Search
- It is easy.
- It needs not to be sorted.
- To search the last element we have element we to scan all the elements.
- If the element is first, then it’s best case bcoz the element is found at first position.


Binary Search
- It is complicated.
- It needs to be sorted.
- To search the last element we don't have to search all elements.
- If the element is first, then also we have to check for some of the elements (average case).

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: