[PR #1499] [CLOSED] feat: Add IntroSort algorithm in C #2100

Open
opened 2026-01-29 15:28:44 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheAlgorithms/C/pull/1499
Author: @sgindeed
Created: 10/8/2025
Status: Closed

Base: masterHead: feat/intro-sort-sgindeed


📝 Commits (1)

  • 96beba9 [FEATURE] Add IntroSort algorithm in C

📊 Changes

1 file changed (+147 additions, -0 deletions)

View changed files

sorting/intro_sort.c (+147 -0)

📄 Description

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::sort in C++.

References

Implements #1488

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/1499 **Author:** [@sgindeed](https://github.com/sgindeed) **Created:** 10/8/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat/intro-sort-sgindeed` --- ### 📝 Commits (1) - [`96beba9`](https://github.com/TheAlgorithms/C/commit/96beba93e478124d8ba40a77eaf3a017a7f7bf90) [FEATURE] Add IntroSort algorithm in C ### 📊 Changes **1 file changed** (+147 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `sorting/intro_sort.c` (+147 -0) </details> ### 📄 Description #### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md --> 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::sort` in C++. #### References <!-- Add any reference to previous pull-request or issue --> Implements [#1488](https://github.com/TheAlgorithms/C/issues/1488) #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Added description of change - [x] Added file name matches [File name guidelines](https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md#File-Name-guidelines) - [x] Added tests and example, test must pass - [x] Relevant documentation/comments is changed or added - [x] PR title follows semantic [commit guidelines](https://github.com/TheAlgorithms/C/blob/master/CONTRIBUTING.md#Commit-Guidelines) - [x] Search previous suggestions before making a new one, as yours may be a duplicate. - [x] I acknowledge that all my contributions will be made under the project's license. 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:28:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#2100