Awesome q2a theme

0 votes

Which of the following is not true about comparison-based sorting algorithms.

- The minimum possible time complexity of a comparison-based sorting algorithm is O(N log N) for a random input array.
- Any comparison-based sorting algorithm can be made stable by using the position as a criteria when two elements are compared.
- Counting Sort is not a comparison-based sorting algorithm.
- Heap Sort is not a comparison-based sorting algorithm.

Choose the correct option.

- 1,2.
- 2,4.
- 4.
- 2.

0 votes

Answer will be Option (C).

1. Yes, Best possible Time Complexity for "Comparison based" Sorting Algorithm is $\Omega(N log N)$. It's proof is based on number of permutations we can get. You can read here.

2. Yes, we can certainly implement so that stability is guaranteed even though the default procedure don't. We might increase time complexity, but, it's certainly possible.

3. Yes, Counting Sort is NOT comparison based sorting Algorithm.

4. No, Heap Sort **is **comparison based. We compare in the heapify function.

So, Option (C).

8,590 questions

2,831 answers

13,617 comments

95,549 users