DATA STRUCTURE
Programming and Technical
Programming
Technical
What is the average number of comparisons in a
sequential search?
Read Solution (Total 3)
-
- (N+1)/2
N-size of array
if element in first position then no of comparison will be 1
or if the element is in last position then no of comparison will be N. - 11 years agoHelpfull: Yes(8) No(0)
- if there are n number of elements in a sequence then there are n-1 no. of steps are required to search an element.
- 10 years agoHelpfull: Yes(0) No(0)
- Avarage number of comparision will be (N+1)/2(N-size of
array).
Because:If elements is in 1st position no of cpmparision
will be one and if the element is in the last position then
no of comparisions will be N. - 7 years agoHelpfull: Yes(0) No(0)
DATA STRUCTURE Other Question