Content #
插入20之后,从该叶子到树根路径上的所有节点,平衡因子都有可能改变,出现不平衡,有可能有多个节点的平衡因子的绝对值超过1。
从新插入的节点向上,找离新插入节点最近的不平衡节点,以该节点为根的子树被称为最小不平衡子树。只需将最小不平衡子树调整为平衡二叉树即可,其他节点不变。
平衡二叉树除了具有适度平衡性,还具有局部性:
- 在单次插入、删除后,至多有O(1)处出现不平衡;
- 总可以在O(logn)时间内,使这O(1)处不平衡重新调整为平衡。
a walk in the park 指轻而易举的事,就好像去公园散步一样简单。a piece of cake. Finding a new job isn’t a walk in the park, especially with the way things are these days. He’s used to hard work and thisis a walk in the park to him.
burn out 精神和体力耗尽。 But staying in this toxic environment is sucking the life out of me, and I’m almost burnt out. It’s h hight-pressure job and you could burn out young.
...breathe down someone’s neck 指某人紧紧盯住,或是监视你。呼吸就在你脖子附近,物理距离一定很近。 It’s awful having a boss who breathes down your neck all the time. It doesn’t help to breathe down someone’s neck. People need some breathing room to get things done.
be in it for oneself 表示自私自利,只为自己谋取利益。 The boss is always breathing down my neck, and my co-workers are so selfish. They’re just in it for themselves and no one cares about teamwork. She was so cold-hearted and just in it for herself.
...as straight as an arrow 诚实可靠,值得依赖。 Jake’s father is known for being straight as an arrow.
to face the music 为你做过的事件负责。 The villain had to face the music when the superhero caught him. After the teacher found out he cheated on the exam, he had to face the music and accept the F he was going to get.
to turn the tables 扭转局面。 The debate turned the tables, so now he’s the main candidate for mayor. I’m more into Shadow Guardian. He turns the tables on villains and always makes them to face the music.
...