Category Archives: Algorithms Quiz

Find minimum number of multiplications in matrix chain multiplication(MCM) of matrix given in sequence A2 x 3, B3 x 4, C4 x 3, D3 x… Read More
What will be the output of following C program? main() { char g[] = "geeksforgeeks"; printf("%s", g + g[6] - g[8]); } (A) geeks (B)… Read More
5 male and 3 female workers can finish a work in 10 days, 8 male and 12 female workers can finish the same work in… Read More
What is the probability of composite numbers in first 100 numbers(1 – 100)? (A) 0.26 (B) 0.62 (C) 0.74 (D) 0.76 Answer: (C) Explanation: Quiz… Read More
In a 100 meters sprint, Usain Bolt beats Tyson Gay by 1 meter. In another 200m sprint, Tyson Gay beats Asafa Powell by 4 meters.… Read More
How many 10 letter words can be formed from the letters in the word SUDO PLACEMENT, starting with S, ending with T and space after… Read More
The average case occurs in the Linear Search Algorithm when: (A) The item to be searched is in some where middle of the Array (B)… Read More
Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair ‘a’ and ‘b’… Read More
What is the best sorting algorithm to use for the elements in array are more than 1 million in general? (A) Merge sort. (B) Bubble sort.… Read More
The auxiliary space of insertion sort is O(1), what does O(1) mean ? (A) The memory (space) required to process the data is not constant.… Read More
Consider the array A[]= {6,4,8,1,3} apply the insertion sort to sort the array . Consider the cost associated with each sort is 25 rupees ,… Read More
Which of the following statements is correct with respect to insertion sort ? *Online - can sort a list at runtime *Stable - doesn't change… Read More
Which is the correct order of the following algorithms with respect to their time Complexity in the best case ? (A) Merge sort > Quick… Read More
Consider an array of elements arr[5]= {5,4,3,2,1} , what are the steps of insertions done while doing insertion sort in the array.   (A) 4… Read More
What is the average case performance for Comb Sort? (Note: ‘i’ in the options is the number if increments) (A) Ω(n2 / i) (B) Ω(n2… Read More