The element being searched for is not found in an array of
100 elements. What is the average number of comparisons
needed in a sequential search to determine that the element
is not there, if the elements are completely unordered?

Answers were Sorted based on User's Feedback



The element being searched for is not found in an array of 100 elements. What is the average number..

Answer / anirban lahiri

Allmost 50 comparison's are required. Because if we use
double pointer instead of single pointer and we run the
algo. untill we get that element. But that ele. is not in
that unordered list then the algo will stop and produces
"No match is found", when the pointers are superimpossed to
each other. That is we set an algo. of two pointer's in the
front and rear end and when each time the matching is not
found then one pointer is go on increasing and the other
one is go on decreasing( in location ).

Is This Answer Correct ?    6 Yes 24 No

Post New Answer

More Data Structures Interview Questions

What is dynamic data structure?

1 Answers  


simple algorithm for bubble sort?

1 Answers  


Give a basic algorithm for searching a binary search tree?

0 Answers  


what is the difference between singly and doubly linked lists?

0 Answers  


What is data type and its types?

0 Answers  


How would you sort words in a large file?

0 Answers   DELL,


What is data structures in computer science?

0 Answers  


Give us a program to reverse a linked list.

0 Answers   DELL, Genpact,


What happens when arraylist is full?

0 Answers  


What is data structure geeksforgeeks?

0 Answers  


Can you declare an array without assigning the size of an array?

0 Answers  


Describe binary tree and its property.

0 Answers  


Categories