2010年10月4日

Step 1: Search

摘要: 5.4.1 Step 1: Search The search step is an extended version of the corresponding code for BST insertion in <BST item insertion function 32>. The earlier code had only two variables to maintain: ... 阅读全文

posted @ 2010-10-04 14:46 sohu2000000 阅读(120) 评论(0) 推荐(1) 编辑

Insertion

摘要: 5.4 Insertion The insertion function for unbalanced BSTs does not maintain the AVL balancing rule, so we have to write a new insertion function. But before we get into the nitty-gritty details, let's ... 阅读全文

posted @ 2010-10-04 14:05 sohu2000000 阅读(345) 评论(0) 推荐(1) 编辑

Operations

摘要: 5.3 Operations Now we'll implement for AVL trees all the operations that we did for BSTs. Here's the outline. Creation and search of AVL trees is exactly like that for plain BSTs, and the generic tabl... 阅读全文

posted @ 2010-10-04 13:40 sohu2000000 阅读(157) 评论(0) 推荐(1) 编辑

Data Types

摘要: 5.2 Data Types We need to define data types for AVL trees like we did for BSTs. AVL tree nodes contain all the fields that a BST node does, plus a field recording its balance factor: This code is incl... 阅读全文

posted @ 2010-10-04 13:32 sohu2000000 阅读(130) 评论(0) 推荐(1) 编辑

Analysis

摘要: 5.1.1 Analysis How good is the AVL balancing rule? That is, before we consider how much complication it adds to BST operations, what does this balancing rule guarantee about performance? This is a sim... 阅读全文

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

导航