Sample Viva Questions and Answers
Sample Viva Questions and Answers
9) The complexity of three algorithms is given as: O(n), O(n2) and O(n3). Which shouldexecute
slowest for large value of n?All will execute in same time.
10) In quick sort, the number of partitions into which the file of size n is divided by a
selectedrecord is 2.
The three factors contributing to the sort efficiency considerations are the efficiency incoding,
machine run time and the space requirement for running the procedure.
11) How many passes are required to sort a file of size n by bubble sort method?
N-112) How many number of comparisons are required in insertion sort to sort a file if the fileis
sorted in reverse order?
A. N2
13) How many number of comparisons are required in insertion sort to sort a file if the
fileis already sorted? N-1
14) In quick sort, the number of partitions into which the file of size n is divided by a
selectedrecord is 2
15) The worst-case time complexity of Quick Sort is________.O(n2)
16)The worst-case time complexity of Bubble Sort is________.O(n2)
17) The worst-case time complexity of Merge Sort is________.O(n log n)
18)The algorithm like Quick sort does not require extra memory for carrying out the
sortingprocedure. This technique is called __________.in-place
19)Which of the following sorting procedures is the slowest?A. Quick sort
A. It can be used to decide the best algorithm that solves a given problem
23) A sort which compares adjacent elements in a list and switches where necessary is ____.A.
insertion sort
24) The correct order of the efficiency of the following sorting algorithms according to
theiroverall running time comparison isbubble>selection>insertion
25) The total number of comparisons made in quick sort for sorting a file of size n, isA. O(n log
n)
27)For the improvement of efficiency of quick sort the pivot can be ______________.
“the mean element”