Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following is not true about comp... Start Learning for Free
Which of the following is not true about comparison based sorting algorithms?
  • a)
    The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input array
  • b)
    Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are compared
  • c)
    Counting Sort is not a comparison based sorting algortihm
  • d)
    Heap Sort is not a comparison based sorting algorithm
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Which of the following is not true about comparison based sorting algo...
Heapsort is a comparison-based sorting algorithm that uses a binary heap data structure. Like mergesort, heapsort has a running time of O ( n log ⁡ n ) , O(n\log n), O(nlogn), and like insertion sort, heapsort sorts in-place, so no extra space is needed during the sort.

Hence Option (D) is correct

For Detailed theory notes on Sorting Algorithm click on the following link:
View all questions of this test
Most Upvoted Answer
Which of the following is not true about comparison based sorting algo...
Comparison Based Sorting Algorithms

Comparison based sorting algorithms are those algorithms that sort an array by comparing elements of the array with each other. Some examples of comparison based sorting algorithms are bubble sort, insertion sort, quicksort, mergesort, heap sort, etc.

Time Complexity

The time complexity of a comparison based sorting algorithm is determined by the number of comparisons made during the sorting process. The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input array. This is because any algorithm that needs to compare elements to sort them requires at least O(nLogn) comparisons.

Stable Sorting Algorithms

A sorting algorithm is said to be stable if it maintains the relative order of equal elements in the sorted array. In other words, if two elements are equal, then the one that appears first in the input array should also appear first in the output array. Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are compared. This means that if two elements are equal, the algorithm should choose the one that appears first in the input array.

Non-Comparison Based Sorting Algorithms

Counting Sort is an example of a non-comparison based sorting algorithm. It does not compare elements to sort them; instead, it uses the frequency of elements in the input array to sort them. Counting Sort has a time complexity of O(n+k), where k is the range of elements in the input array.

Heap Sort is a comparison based sorting algorithm that uses a heap data structure to sort elements. It has a time complexity of O(nLogn) and is not a stable sorting algorithm.

Conclusion

In conclusion, the statement that Heap Sort is not a comparison based sorting algorithm is true. It is a comparison based sorting algorithm, but it is not a stable sorting algorithm. Counting Sort is an example of a non-comparison based sorting algorithm that uses the frequency of elements to sort them.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer?
Question Description
Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following is not true about comparison based sorting algorithms?a)The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input arrayb)Any comparison based sorting algorithm can be made stable by using position as a criteria when two elements are comparedc)Counting Sort is not a comparison based sorting algortihmd)Heap Sort is not a comparison based sorting algorithmCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev