What is the average number of comparisons needed in a
sequential search to determine the position of an element in
an array of 100 elements, if the elements are ordered from
largest to smallest?
Answer Posted / wonder
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.
| Is This Answer Correct ? | 31 Yes | 0 No |
Post New Answer View All Answers
Why is concurrenthashmap thread safe?
How do you represent a linked list?
How is the front of the queue calculated ?
What is a stable algorithm?
State the difference between primitive and non-primitive data types?
What is the need of sorting?
Do all declaration statements result in a fixed reservation in memory?
Which is better bubble sort or selection sort?
What is 1d array?
Which is faster hashmap or hashtable?
Why it is important to have aligned addresses? What is the exception generated when there is a misaligned address?
List the area of applications where stack data structure can be used?
For addition and deletion. Which one is most preferred: array list or linked list?
Write the syntax in c to create a node in the singly linked list.
What is the use of hashtable?