MergeSort and RadixSort-Heaps Flashcards

(5 cards)

1
Q

How does MergeSort work?

A

Recursively divides the array, sorts each half, then merges the sorted halves.
Time complexity: O(n log n), stable, not in-place.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Radix Sort?

A

A non-comparison sorting algorithm that sorts data by processing individual digits or characters, starting with the least significant digit.
Time complexity: O(nk), where k is the number of digits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When is Radix Sort preferable?

A

When sorting large datasets of integers or strings with fixed maximum length.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Heap?

A

A complete binary tree satisfying the heap property: each parent is greater (max-heap) or smaller (min-heap) than its children.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does HeapSort work?

A

Builds a heap, repeatedly removes the max (or min), and rebuilds the heap.
Time complexity: O(n log n), not stable, in-place.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly