Question 1
How many passes does an insertion sort algorithm consist of? N N-1 N+1 N^2
Question 2
What is the average case running time of an insertion sort algorithm? O(N) O(N log N) O(log N) O(N^2)
Question 3
What is the running time of an insertion sort algorithm if the input is pre-sorted? O(N^2) O(N log N) O(N) O(M log N)
Question 4
What will be the number of passes to sort the elements using insertion sort? 14, 12,16, 6, 3, 10 6 5 7 1
Question 5
For the following question, how will the array elements look like after second pass? 34, 8, 64, 51, 32, 21 8, 21, 32, 34, 51, 64 8, 32, 34, 51, 64, 21 8, 34, 51, 64, 32, 21 8, 34, 64, 51, 32, 21,
Question 6
Which of the following real time examples is based on insertion sort? arranging a pack of playing cards database scenarios and distributes scenarios arranging books on a library shelf real-time systems
Question 7
Which of the following examples represent the worst case input for an insertion sort? array in sorted order array sorted in reverse order normal unsorted array large array
Question 8
In the following scenarios, when will you use selection sort? The input is already sorted A large file has to be sorted Large values need to be sorted with small keys Small values need to be sorted with large keys
Question 9
What is the advantage of selection sort over other sorting techniques? It requires no additional storage space It is scalable It works best for inputs which are already sorted It is faster than any other sorting technique
Question 10
What is the disadvantage of selection sort? It requires auxiliary memory It is not scalable It can be used for small keys It takes linear time to sort the elements,
Question 11
What is the best case complexity of selection sort? O(nlogn) O(logn) O(n) O(n^2)
Question 12
What is an external sorting algorithm? Algorithm that uses tape or disk during the sort Algorithm that uses main memory during the sort Algorithm that involves swapping Algorithm that are considered ‘in place’
Question 13
The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array? 4 2 1 0
Question 14
Which of the following is good for sorting arrays having less than 100 elements? Quick Sort Selection Sort Merge Sort Insertion Sort
Question 15
Which of the following is not an exchange sort? Bubble Sort Quick Sort Partition-exchange Sort Insertion Sort