a) Insertion sort

b) Selection sort

c) Bubble sort

d) Merge sort

View Answer / Hide Answer

**ANSWER: B**

a) Merge sort

b) Typical in-place quick sort

c) Heap sort

d) Selection sort

View Answer / Hide Answer

**ANSWER: A**

a) Selection sort

b) Heap sort

c) Quick sort

d) Merge sort

View Answer / Hide Answer

**ANSWER: D**

a) O(n)

b) O(nlogn)

c) O(n

d) None

View Answer / Hide Answer

**ANSWER: B**

a) O(n

b) O(nlogn)

c) O(nloglogn)

d) O(n)

View Answer / Hide Answer

**ANSWER: B**

a) Counting sort

b) Bucket sort

c) Radix sort

d) Shell sort

View Answer / Hide Answer

**ANSWER: D**

a) O(logn)

b) O(n)

c) O(nlogn)

d) O(n

View Answer / Hide Answer

**ANSWER: C**

a) Insertion sort

b) Selection sort

c) Quick sort

d) Merge sort

View Answer / Hide Answer

**ANSWER: A**

a) Insertion sort

b) Selection sort

c) Quick sort

d) None

View Answer / Hide Answer

**ANSWER: B**

a) Insertion sort

b) Selection sort

c) Heap sort

d) None

View Answer / Hide Answer

**ANSWER: B**

a) θ (n)

b) θ (nlogn)

c) θ (n

d) θ (n(logn)

View Answer / Hide Answer

**ANSWER: A**

a) Counting sort

b) Bucket sort

c) Radix sort

d) Quick sort

View Answer / Hide Answer

**ANSWER: C**

a) Insertion sort

b) Selection sort

c) Quick sort

d) Heap sort

View Answer / Hide Answer

**ANSWER: D**

a) Counting sort

b) Bucket sort

c) Radix sort

d) All of the above

View Answer / Hide Answer

**ANSWER: D**

a) 0

b) n

c) nlogn

d) n

View Answer / Hide Answer

**ANSWER: A**

a) θ (n)

b) θ (nlogn)

c) θ (n

d) none

View Answer / Hide Answer

**ANSWER: B**

a) θ (n)

b) θ (nlogn)

c) θ (n

d) None

View Answer / Hide Answer

**ANSWER: A**

a) Counting sort

b) Radix sort

c) Bucket sort

d) None

View Answer / Hide Answer

**ANSWER: B**

a) Insertion sort

b) Counting sort

c) Selection sort

d) Bubble sort

View Answer / Hide Answer

**ANSWER: C**

a) Insertion sort

b) Quick sort

c) Merge sort

d) Selection sort

View Answer / Hide Answer

**ANSWER: D**

a) O(n)

b) O(nlogn)

c) O(n

d) O(n

View Answer / Hide Answer

**ANSWER: A**

a) Ω (1)

b) Ω (n)

c) Ω (nlogn)

d) Ω (n

View Answer / Hide Answer

**ANSWER: C**

a) Heap sort

b) Quick sort

c) Merge sort

d) Radix sort

View Answer / Hide Answer

**ANSWER: D**

a) Dynamic programming

b) Backtracking

c) Divide-and-conquer

d) Greedy method

View Answer / Hide Answer

**ANSWER: C**

a) Divide-and-conquer

b) Backtracking

c) Heuristic approach

d) Greedy approach

View Answer / Hide Answer

**ANSWER: A**

a) O(m)

b) O(n)

c) O(m+n)

d) O(logm + logn)

View Answer / Hide Answer

**ANSWER: C**

a) Takes O(nlogn) times

b) Maintains the relative order of occurrence of non-distinct elements

c) Uses divide-and-conquer paradigm

d) Takes O(n) space

View Answer / Hide Answer

**ANSWER: B**

a) θ (nlogn)

b) θ (n)

c) θ (logn)

d) θ (1)

View Answer / Hide Answer

**ANSWER: A**

a) θ (n

b) θ (nlogn)

c) θ (n

d) θ (n)

View Answer / Hide Answer

**ANSWER: D**

a) θ (n)

b) θ (logn)

c) θ (loglogn)

d) θ (1)

View Answer / Hide Answer

**ANSWER: A**

**RE: MCQs on Sorting with answers -Aarav Pant (08/14/20)**- Thank for the mcqs with answers.
**In a heap with n elements with the smallest element at the root, the seventh smallest element can be found in time -Abhishek Kumar (09/16/18)**- Answer-O(1).

For k-1 times repeat the following :

Extract the root of the new min-heap using extract-min and insert the 2 children of the extracted root from the original heap into the new heap. Resulting heap will contain k elements and root of which will be our kth smallest in the original heap. This grows the new heap by one on every removal (remove one, add two), which means it will never hold more than K elements, and so the remove-one-add-two will take O(3*log(K)). After k iterations, it is O(3*k*logk) = O(k*logk).

In order to implement this, Nodes in the new heap should store indexes of their corresponding nodes in the original heap, rather than the node values themselves.

For 7 elements, it will take 7log7 = O(1) time as new heap will create only 7 elements. **RE: MCQs on Sorting with answers -Sushil Tiwari (03/17/17)**- Under the section of sorting question number 11 which is something like "Time complexity of bubble sort in best case is ?"

Answer for this question is O(n^2) not O(n) as your explanation says.You could verify the correction on Wikipedia or other standard references. **RE: MCQs on Sorting with answers -Tim (01/09/17)**- I think Q28 should have a more suitable answer as O(logn).

We got a "seventh smallest" as a constant, but we still have to adjust the heap in O(logn) time. **RE: MCQs on Sorting with answers -praffulla (08/14/16)**- Q28 should have answer as O(1).

- MCQs on Tree with answers
- MCQs on stacks with answers
- MCQs on Queue with answers
- MCQs on Sorting with answers
- Placement papers on Data Structure - Set 1
- Placement papers on Data Structure - Set 3
- Placement papers on Data Structure - Set 2
- Data Structure placement model papers
- MCQs on Linked list with answers
- Placement papers on Data Structure - Set 4