#ifndef __XYSDK_QUEUE_H__
#define __XYSDK_QUEUE_H__



// 定义堆节点结构体
typedef struct xy_heap_node {
    void* data;
    uint8_t priority; // 优先级
} xy_heap_node;

// 定义优先级队列结构体
typedef struct xy_priority_queue {
    xy_heap_node** nodes;
    uint8_t capacity;
    uint8_t size;
} xy_priority_queue;

xy_heap_node* xysdk_queue_create_heap_node(void* data, uint8_t priority);
void xysdk_queue_init_priority_queue(xy_priority_queue* queue, uint8_t capacity); 
void xysdk_queue_heapify_down(xy_priority_queue* queue, uint8_t index); 
int xysdk_queue_append(xy_priority_queue* queue, void* data, uint8_t priority); 
void* xysdk_queue_delete(xy_priority_queue* queue); 
void xysdk_queue_print(xy_priority_queue* queue, void (*printFunc)(void*));

#endif