[FEATURE]Add Binary Heap Algorithm (Min Heap) in C #196

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

Originally created by @mad-alpha on GitHub (Oct 4, 2025).

Detailed description

### PROPOSAL

Add a Min Binary Heap implementation in C (under Binary tree in c folder) — a tree-based data structure that keeps the smallest element at the root, ensuring efficient retrieval in constant time.

The implementation supports key heap operations such as insertion, extraction, search, and display, with proper memory management and clear documentation.

⚙️ Features

Insert: Adds an element while maintaining the heap property (heapify-up).

Extract Min: Removes and returns the smallest element (heapify-down).

Search: Linear search for a given value.

Display: Prints all elements in array order.

Dynamic memory management to avoid leaks.

⏱️ Time Complexity

Insert: O(log n)

Extract Min: O(log n)

Search: O(n)

Get Min (Peek): O(1)

Display: O(n)

Context

Please assign this to me as I want to contribute under Hacktoberfest2025.

Possible implementation

Below is the implementation of Min Binary heap in C :

Min Binary Heap.c

Additional information

No response

Originally created by @mad-alpha on GitHub (Oct 4, 2025). ### Detailed description **### PROPOSAL** Add a **Min Binary Heap implementation in C** (under Binary tree in c folder) — a tree-based data structure that keeps the smallest element at the root, ensuring efficient retrieval in constant time. The implementation supports key heap operations such as insertion, extraction, search, and display, with proper memory management and clear documentation. **⚙️ Features** Insert: Adds an element while maintaining the heap property (heapify-up). Extract Min: Removes and returns the smallest element (heapify-down). Search: Linear search for a given value. Display: Prints all elements in array order. Dynamic memory management to avoid leaks. **⏱️ Time Complexity** Insert: O(log n) Extract Min: O(log n) Search: O(n) Get Min (Peek): O(1) Display: O(n) ### Context Please assign this to me as I want to contribute under Hacktoberfest2025. ### Possible implementation Below is the implementation of Min Binary heap in C : [Min Binary Heap.c](https://github.com/user-attachments/files/22702635/Min.Binary.Heap.c) ### Additional information _No response_
claunia added the Staleenhancement labels 2026-01-29 15:08:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#196