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?
Answer Posted / poonam
IN sequential search (average case =[1/2(best case)+(wrost case)])...its the formula to calculate the average case of sequential search ...
so best case is when we found the element in first comparison.
worst case is when we found element in 100 comparison.
average case is =1/2(1+100)
ans would be 50.5
Is This Answer Correct ? | 11 Yes | 5 No |
Post New Answer View All Answers
Will hashmap allow null keys?
Explain the uses of binary tree.
What is meant by int?
Which is better array or linked list?
What do you mean by collision in hashing?
Which sorting algorithm is used in collections sort?
How to sort an Array?
What are all the classes and interfaces that are available in the collections?
Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).
Can arraylist contain duplicates?
Can arraylist have duplicates?
Write program for Quick sort ?
What is difference between list and array list?
Explain different methods in which you can traverse a tree?
Explain the internal working of a hash map?