1.适配AVL。

This commit is contained in:
MacRsh
2023-11-18 00:54:01 +08:00
parent 9178804396
commit 639c0c3b94
3 changed files with 48 additions and 0 deletions

View File

@@ -118,6 +118,12 @@ typedef int (*mr_init_fn_t)(void);
#define MR_DISABLE (0) /**< Disable */
#define MR_ENABLE (1) /**< Enable */
/**
* @brief True/false.
*/
#define MR_FALSE (0) /**< False */
#define MR_TRUE (1) /**< True */
/**
* @brief Double linked list structure.
*/
@@ -141,6 +147,17 @@ struct mr_ringbuf
uint16_t write_index; /**< Write index */
};
/**
* @brief AVL tree structure.
*/
struct mr_avl
{
int32_t height; /**< Balance factor */
uint32_t value; /**< Key-hold */
struct mr_avl *left_child; /**< Point to left-child node */
struct mr_avl *right_child; /**< Point to right-child node */
};
/**
* @brief Driver types.
*/