《数据结构的算法在C++中的应用》(英文版)Chapter 11 Search Trees

Chapter 11 Search trees
Chapter 11 Search Trees

11. 1 Binary search Trees 1. Definition a binary search tree is a binary tree that may be empty. a nonempty binary search tree satisfies the following properties 1 )Every element has a key and no two elements have the same key; therefore, all keys are distinct
11.1 Binary Search Trees 1.Definition: A binary search tree is a binary tree that may be empty.A nonempty binary search tree satisfies the following properties: 1)Every element has a key and no two elements have the same key; therefore,all keys are distinct

11. 1 Binary search Trees )The keys(if any)in the left subtree of the root are smaller than the key in the root 3)The keys(if any)in the right subtree of the root are larger than the key in the root 4The left and right subtrees of the root are also binary search trees
11.1 Binary Search Trees 2)The keys(if any)in the left subtree of the root are smaller than the key in the root. 3)The keys(if any)in the right subtree of the root are larger than the key in the root. 4)The left and right subtrees of the root are also binary search trees

11. 1 Binary search Trees Example 45 Inherit the linked representation of binary tree 12) 53) Leftchild data rightchild 3)③7 0 90 78)
11.1 Binary Search Trees • Example: 45 12 53 90 78 100 24 61 3 37 Leftchild data rightchild Inherit the linked representation of binary tree

11. 1 Binary search Trees An indexed binary search tree is derived from an ordinary binary search tree by adding the field Leftsize to each tree node Value in leftsize field number of the elements in the node's left subtree +1 leftSize leftchild data rightChild
11.1 Binary Search Trees • An indexed binary search tree is derived from an ordinary binary search tree by adding the field LeftSize to each tree node. • Value in Leftsize field=number of the elements in the node’s left subtree +1 leftSize leftChild data rightChild

11. 1 Binary Search Trees Example 420 15 25 1|^12[1^18~1^30
11.1 Binary Search Trees • Example: 4 20 2 15 1 ^ 25 1 ^ 12 ^ 1 ^ 18 ^ 1 ^ 30 ^

11. 1 Binary search Trees 2. ADT specification of BSTree(ADT 11.1) AbstractDataType BStreei Instances binary trees, each node has an element with a key field; all keys are distinct; keys in the left subtree of any node are smaller than the key in the node; those in the right subtree are larger
11.1 Binary Search Trees 2.ADT specification of BSTree(ADT 11.1) AbstractDataType BSTree{ instances binary trees,each node has an element with a key field;all keys are distinct;keys in the left subtree of any node are smaller than the key in the node; those in the right subtree are larger

11. 1 Binary search Trees operations Create: create an empty binary search tree Search(k, e); return in e the element with key k return false if the operation fails return true if it succeeds Insert(e): insert element e into the search tree Delete(k, e): delete the element with key k and return it in e Ascendo: Output all elements in ascending order of key
11.1 Binary Search Trees operations: Create(): create an empty binary search tree Search(k,e):return in e the element with key k return false if the operation fails, return true if it succeeds Insert(e): insert element e into the search tree Delete(k,e):delete the element with key k and return it in e Ascend():Output all elements in ascending order of key }

11. 1 Binary search Trees 2. ADT specification of IndexedBSTree (ADT112) AbstractData Type IndexedBSTree instances same as for Bs tree except that each node has a LeftSize field operations Create: create an empty indexed binary search tree
11.1 Binary Search Trees 2. ADT specification of IndexedBSTree (ADT 11.2) AbstractDataType IndexedBSTree{ instances same as for BSTree except that each node has a LeftSize field operations Create(): create an empty indexed binary search tree

11. 1 Binary search Trees Search(k, e): return in e the element with key k return false if the operation fails return true if it succeeds IndexSearch(k, e) return in e the kth element Insert(e): insert element e into the search tree Delete(k, e): delete the element with key k and return it in e IndexDelete(k, e): delete the kth element and return it In e Ascendo Output all elements in ascending order of key
11.1 Binary Search Trees Search(k,e):return in e the element with key k return false if the operation fails, return true if it succeeds IndexSearch(k,e): return in e the kth element Insert(e): insert element e into the search tree Delete(k,e): delete the element with key k and return it in e IndexDelete(k,e): delete the kth element and return it in e Ascend(): Output all elements in ascending order of key }
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《数据结构的算法在C++中的应用》(英文版)Chapter 9 Priority Queues.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 8 Binary and other trees.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 7 Hashing.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 6 Queue.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 5 Stack.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 4 Arrays and Matrix.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 3 Linear List.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 2 Program performance.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 1 preface.ppt
- 《数据结构的算法在C++中的应用》(英文版)Textbook.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第9章 宏.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第8章 数据访问页.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第7章 建立Access报表.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第6章 Access窗体的操作.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第5章 查询的创建及应用.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第4章 建构Access数据库表.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第3章 创建Access数据库.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第2章 Access 2002应用基础.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第1章 数据库原理及基本概念.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第12章 综合实例应用.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 12 Graphs.ppt
- 四川电力职业技术学院:《ASP网络程序设计》目录.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第五章 数据库基础知识.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第二章 ASP初步.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第一章 网络程序设计概述.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第三章 ASP脚本语 VBScript.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第四章 ASP常用内部对象.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第六章 ASP数据库编程.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第八章 使用第三方组件.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第七章 文件存取组件及其它组.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第一章 网络程序设计概述.ppt
- 《ASP动态网页设计》电子教案.doc
- 《ASP动态网页设计》教学大纲.doc
- 《ASP动态网页设计》教学进度表.doc
- 《ASP动态网页设计》进度计划.doc
- 《ASP动态网页设计》课程设计指导书.doc
- 《ASP动态网页设计》课程综合习题集.doc
- 《ASP动态网页设计》实验指导书.doc
- 《动态网页制作》第一章 动态网页概论.ppt
- 《动态网页制作》第三章 表格与表单(组件)目录2.ppt