31#define DEBUG_PRINT(...) printf(__VA_ARGS__)
33#define DEBUG_PRINT(...)
void binary_heapify_up(binary_heap_t *p_heap, uint16_t index)
Moves the node at the given index down the binary heap to maintain the heap property....
Definition: binary_heap.c:32
uint16_t binary_heap_get_node_idx(const binary_heap_t *p_heap, const maze_grid_cell_t *p_maze_node)
Finds the index of a given node in the binary heap if it exists. Otherwise, returns UINT16_MAX.
Definition: binary_heap.c:232
struct binary_heap binary_heap_t
Struct containing the binary heap.
struct binary_heap_node binary_heap_node_t
This struct contains basic information about a node in a priority queue implemented with a binary hea...
binary_heap_node_t binary_heap_peek(binary_heap_t *p_heap)
Peeks at the root node of the binary heap.
Definition: binary_heap.c:216
void binary_heap_insert(binary_heap_t *p_heap, maze_grid_cell_t *p_maze_node, uint16_t priority)
Inserts a grid cell node into the binary heap with a given priority.
Definition: binary_heap.c:147
void binary_heapify_down(binary_heap_t *p_heap, uint16_t index)
Moves the node at the given index up the binary heap to maintain the heap property....
Definition: binary_heap.c:88
maze_grid_cell_t * binary_heap_delete_min(binary_heap_t *p_heap)
Deletes and returns the root node from the binary heap.
Definition: binary_heap.c:183
Header file for the maze data structure and public functions.
This struct contains basic information about a node in a priority queue implemented with a binary hea...
Definition: binary_heap.h:45
uint16_t priority
Definition: binary_heap.h:46
maze_grid_cell_t * p_maze_node
Pointer to a node in the maze.
Definition: binary_heap.h:48
Struct containing the binary heap.
Definition: binary_heap.h:59
binary_heap_node_t * p_array
Pointer to the first element of the array.
Definition: binary_heap.h:60
uint16_t capacity
Definition: binary_heap.h:61
uint16_t size
Current number of nodes in the binary heap.
Definition: binary_heap.h:64
This struct contains the node information.
Definition: maze.h:91