2010年10月31日

遍历

摘要: 5.6 遍历Traversal is largely unchanged from BSTs. However, we can be confident that the tree won't easily exceed the maximum stack height, because of the AVL balance condition, so we can omit checking f... 阅读全文

posted @ 2010-10-31 20:47 sohu2000000 阅读(261) 评论(0) 推荐(1) 编辑

镜像情形

摘要: 5.5.6 镜像情形 下面的的代码是前几节所讲的代码的镜像情形代码实现,在这种情况里面,我们删除的节点位于某个节点的右子树上面 阅读全文

posted @ 2010-10-31 19:21 sohu2000000 阅读(151) 评论(0) 推荐(1) 编辑

Step 5: Finish Up

摘要: 5.5.5 Step 5: Finish Up This code is included in 164. 阅读全文

posted @ 2010-10-31 16:02 sohu2000000 阅读(124) 评论(0) 推荐(0) 编辑

Step 4: Rebalance

摘要: Step 4: Rebalance Now we have to write code to rebalance when it becomes necessary. We'll use rotations to do this, as before. Again, we'll distinguish the cases on the basis of x's balance factor, wh... 阅读全文

posted @ 2010-10-31 13:09 sohu2000000 阅读(152) 评论(0) 推荐(1) 编辑

导航