Introduce a binary min-heap implementation as a generic data structure for use in kernel and application code. A min-heap always maintains the smallest element at the root, making insertion and removal of the minimum element efficient (O(log n)). The API allows both static and dynamic initialization, supports custom comparators. Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
23 lines
881 B
Plaintext
23 lines
881 B
Plaintext
# Copyright (c) 2025 Aerlync Labs Inc.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
config MIN_HEAP
|
|
bool "Min-Heap Data Structure"
|
|
help
|
|
Enable support for a generic Min-Heap data structure library.
|
|
|
|
A Min-Heap is a binary tree-based data structure in which the
|
|
smallest element is always at the root. It supports efficient
|
|
insertion and removal of the minimum element in O(log n) time,
|
|
making it useful for priority queues, schedulers, and timeout
|
|
queues.
|
|
|
|
This implementation is designed for general-purpose use in both
|
|
kernel and application code. It supports static and dynamic
|
|
initialization and allows for custom comparator functions.
|
|
|
|
Note: This is unrelated to the kernel's heap memory allocator
|
|
(used for dynamic memory allocation with `k_malloc()` or
|
|
`k_heap_alloc()`). The "heap" in Min-Heap refers to the ordering
|
|
structure, not memory management.
|