mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-15 21:51:05 +00:00
[PR #1499] feat: Add IntroSort algorithm in C #2104
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/1499
State: closed
Merged: No
Description of Change
Added an implementation of IntroSort (Introspective Sort) in C.
IntroSort is a hybrid sorting algorithm that begins with QuickSort, switches to HeapSort when the recursion depth exceeds a limit, and uses InsertionSort for small subarrays.
This approach achieves both fast average performance and optimal worst-case behavior — the same principle used by
std::sortin C++.References
Implements #1488
Checklist
Notes: Added a practical, high-performance hybrid sorting algorithm combining QuickSort, HeapSort, and InsertionSort for balanced performance and guaranteed O(n log n) complexity in the worst case.