What Is The Difference Between Binary Search And Sequential Search?

1

1 Answers

Anonymous Profile
Anonymous answered
Hi friend,
binary search  search a value by a mid-value.where as  in seq search ,it search values one by one.
Example:seq search
1,6,8,4;suppose that I have to search a value 8,
then it start searching from 1,then next and stop where it get value.

Example:binary:
1,6,9,4,5,7; suppose my search value is 4.it will star searching as
mid=(total no .element)/2
  =6/2
  =3
means search position is 3,it will check value at position 3 with the searched value if it is greater then it will move to just right of it other wise left.
So here it will move to right .and right of 9 is 4 which is our searched value.so after that it stop search.
Hope you understand.plz reply if you didn't get.I will give you another example.
Bye dear.

Answer Question

Anonymous