Recall & Review
beginner
What is comparison based sorting?
Sorting methods that decide the order of elements by comparing them with each other, like checking if one number is bigger or smaller than another.
Click to reveal answer
beginner
Name two common comparison based sorting algorithms.
Bubble Sort and Quick Sort are examples of comparison based sorting algorithms.
Click to reveal answer
beginner
What is non comparison based sorting?
Sorting methods that do not compare elements directly but use other information like counting or grouping to sort, such as counting sort or radix sort.
Click to reveal answer
intermediate
Why can non comparison based sorting be faster than comparison based sorting?
Because they use special tricks like counting or grouping, they can sort in linear time for certain types of data, unlike comparison based sorting which usually takes longer.
Click to reveal answer
intermediate
What is the best time complexity possible for comparison based sorting?
The best possible time complexity for comparison based sorting is O(n log n), meaning it takes at least that much time to sort n items by comparing.
Click to reveal answer
Which of these is a comparison based sorting algorithm?
✗ Incorrect
Quick Sort sorts by comparing elements, so it is comparison based.
Non comparison based sorting algorithms usually work best when:
✗ Incorrect
Non comparison based sorting like counting sort works best when data values are within a limited range.
What is the lower bound time complexity for comparison based sorting?
✗ Incorrect
Comparison based sorting cannot be faster than O(n log n) in the general case.
Which sorting method uses counting to sort elements?
✗ Incorrect
Counting Sort counts the number of occurrences of each value to sort.
Radix Sort is an example of:
✗ Incorrect
Radix Sort sorts numbers digit by digit without comparing elements directly.
Explain the main difference between comparison based and non comparison based sorting.
Think about how the algorithms decide the order of elements.
You got /3 concepts.
Describe a scenario where non comparison based sorting is more efficient than comparison based sorting.
Consider when counting or grouping helps speed up sorting.
You got /3 concepts.