LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
JUNO_DS_HEAP_POINTER_API_TAG Struct Reference

Element-level operations required by the heap. More...

#include <heap_api.h>

Data Fields

JUNO_DS_HEAP_COMPARE_RESULT_T(* Compare )(JUNO_DS_HEAP_ROOT_T *ptHeap, JUNO_POINTER_T tParent, JUNO_POINTER_T tChild)
 Compare two values to determine ordering (heap property).
 
JUNO_STATUS_T(* Swap )(JUNO_DS_HEAP_ROOT_T *ptHeap, JUNO_POINTER_T tLeft, JUNO_POINTER_T tRight)
 Swap two values in the underlying storage.
 

Detailed Description

Element-level operations required by the heap.

Field Documentation

◆ Compare

JUNO_DS_HEAP_COMPARE_RESULT_T(* JUNO_DS_HEAP_POINTER_API_TAG::Compare) (JUNO_DS_HEAP_ROOT_T *ptHeap, JUNO_POINTER_T tParent, JUNO_POINTER_T tChild)

Compare two values to determine ordering (heap property).

Return true if the heap property holds for (parent, child). For max-heap: parent >= child. For min-heap: parent <= child. Must not modify elements; return status != SUCCESS indicates error.

◆ Swap

JUNO_STATUS_T(* JUNO_DS_HEAP_POINTER_API_TAG::Swap) (JUNO_DS_HEAP_ROOT_T *ptHeap, JUNO_POINTER_T tLeft, JUNO_POINTER_T tRight)

Swap two values in the underlying storage.

Exchange element values referenced by tLeft and tRight. Return an error status to abort the heap operation if swap cannot be performed.


The documentation for this struct was generated from the following file: