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 / mohit0749

I think it we can apply binary search which requires only logn comparison becoz elements are ordered (largest to smallest).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

There is a program which inserts and deletes node in a sorted singly linked list. There is a bug in one of the modules, how would you debug it?

1315


Why heap sort is not used?

480


Explain the term run-time stack?

622


What is faster array or arraylist?

467


How do you sort pseudocode?

501






What are the different types of data structures explain briefly?

539


What will happen if an array goes out of bounds?

667


Differentiate between the singly linked list and doubly linked list.

596


Is binary tree balanced?

475


What is the height of an empty tree?

541


Define non-linear data structures?

567


What is meant by strongly connected in a graph?

515


Which sorting is best?

489


What are the advantages of data structure?

532


How do you balance a tree?

513