What is the average number of comparisons in a sequential
search?
Answer Posted / kalyani
Searching an element in an array, the search starts from the first element till the last element the average number of comparisons in a sequential search is (N+1)/2,where N is the size. The number of comparisons will be 1, if element is in the first position and if element is in the last position the number of comparisons will be N.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is an example of an array?
What is a Queue? Explain its operation with example?
How do you represent a linked list?
What is the default capacity of hashmap?
What is a directed graph?
How do you find a string is anagram or not?
Is array a data type?
Which interfaces are implemented by concurrentskiplistset?
What is the use of space complexity and time complexity?
What is priority queue in data structure?
Explain binary search tree?
Can you override methods of arraylist?
write an algorithm to show the procedure of insertion into a b-tree?
Can hashset contain null?
Provide an algorithm to reverse a linked list without using recursion.