环形数组实现队列

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/201c29f7-12eb-4a3f-b0bf-4db213cdaa78/Untitled.png

树和二叉搜索树

树的Bushy

即每个非叶子结点都有两个孩子

对这样的茂盛的树,查找的复杂度为log(n)

对二叉树插入结点

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/14c6bb46-1130-4c29-9637-26ac0125d35b/Untitled.png

递归式寻找叶子结点,找到并插入后,再递归更新父节点

对二叉树删除结点

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5fc73d8d-c972-453a-a17b-4cbebcadc5f9/21_.pdf

平衡二叉搜索树

左旋 右旋

对某结点进行右旋时,让其左子树的右指针指向该结点,而其原左子树的右结点则成为右旋结点的左树

左旋相反