1.适配AVL。
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user