amino  1.0-beta2
Lightweight Robot Utility Library
heap.h File Reference

Simple Heap / Heapsort. More...

Go to the source code of this file.

Typedefs

typedef int(* aa_compar_fun) (const void *a, const void *b)
 A comparison function. More...
 

Functions

void aa_aheap_heapify (uint8_t *base, size_t nmemb, size_t size, size_t i, aa_compar_fun compar)
 The "heapify" operation. More...
 
void aa_aheap_sort (void *base, size_t nmemb, size_t size, aa_compar_fun compar)
 Perform heapsort.
 
void aa_aheap_build (uint8_t *base, size_t nmemb, size_t size, aa_compar_fun compar)
 Build a heap from an array.
 

Detailed Description

Simple Heap / Heapsort.

Definition in file heap.h.

Typedef Documentation

◆ aa_compar_fun

typedef int(* aa_compar_fun) (const void *a, const void *b)

A comparison function.

The function should return an integer less than, equal to, or greater than zero if a is found, respectively, to be less than, to match, or be greater than b.

Definition at line 56 of file heap.h.

Function Documentation

◆ aa_aheap_heapify()

void aa_aheap_heapify ( uint8_t *  base,
size_t  nmemb,
size_t  size,
size_t  i,
aa_compar_fun  compar 
)

The "heapify" operation.

Manipulates the tree rooted at index i so that it becomes a heap.