What is the time complexity of Shell Sort?
What is the time complexity of Shell Sort?
Approach: Analyze gap-based sorting.
Depends on the gap sequence. Typically between O(n log n) and O(n^2). Common sequences yield O(n^1.25).
Follow-up: Is Shell Sort stable?
Key concepts: gap sequence, insertion sort.