Recall & Review
beginner Click to reveal answer
What is comparison based sorting?
Sorting methods that decide the order by comparing elements directly, like checking if one number is bigger than another.
beginner Click to reveal answer
Name two common comparison based sorting algorithms.
Bubble Sort and Quick Sort are examples where elements are compared to decide their order.
beginner Click to reveal answer
What is non comparison based sorting?
Sorting methods that do not compare elements directly but use other properties like digits or counts to sort, for example, counting sort.
intermediate Click to reveal answer
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 when conditions are right, avoiding many comparisons.
intermediate Click to reveal answer
What is the best time complexity possible for comparison based sorting?
O(n log n) is the fastest possible average time for comparison based sorting algorithms.
Which sorting type uses direct element comparisons?
✗ Incorrect
Comparison based sorting uses direct comparisons between elements.
Which algorithm is an example of non comparison based sorting?
✗ Incorrect
Counting sort sorts by counting occurrences, not by comparing elements.
What is the average time complexity lower bound for comparison based sorting?
✗ Incorrect
Comparison based sorting cannot be faster than O(n log n) on average.
Which sorting method can achieve linear time complexity under certain conditions?
✗ Incorrect
Counting sort can run in O(n) time when the range of input is limited.
Which sorting type is generally more flexible for any kind of data?
✗ Incorrect
Comparison based sorting works on any data that can be compared.
Explain the main difference between comparison based and non comparison based sorting.
Think about how the sorting decides order.
You got /4 concepts.
Describe when you would choose non comparison based sorting over comparison based sorting.
Consider input data properties and speed needs.
You got /4 concepts.
