The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Lecture 8 - binary trees Next: Lecture 9 - catch Up: No Title Previous: Lecture 7 - elementary Lecture 8 - binary trees Listen To Part 8-1 9.1-3 Show that there is no sorting algorithm which sorts at least instances in O(n) time. Think of the decision tree which can do this. What is the shortest tree with leaves? Moral: there cannot be too many good cases for any sorting algorithm! Listen To Part 8-2 9.1-4 Show that the lower bound for sorting still holds with ternary comparisons. The maximum number of leaves in a tree of height h is , So it goes for any constant base. Listen To Part 8-3 ``I think that I shall never see a poem as lovely as a tree Poem's are wrote by fools like me but only G-d can make a tree `` file:///E|/LEC/LECTUR17/NODE8.HTM (1 of 13) [19/1/2003 1:34:46] Binary Search Trees
Lecture 8 - binary trees - Joyce Kilmer Binary search trees provide a data structure which efficiently supports all six dictionary operations. A binary tree is a rooted tree where each node contains at most two children. Each child can be identified as either a left or right child. A binary tree can be implemented where each node has left and right pointer fields, an (optional) parent pointer, and a data field. Listen To Part 8-4 Binary Search Trees A binary search tree labels each node in a binary tree with a single key such that for any node x, and nodes in the left subtree of x have keys and all nodes in the right subtree of x have key's . Left: A binary search tree. Right: A heap but not a binary search tree. The search tree labeling enables us to find where any key is. Start at the root - if that is not the one we want, search either left or right depending upon whether what we want is or then the root. Listen To Part 8-5 Dictionary search operations are easy in binary trees ... TREE-SEARCH(x, k) file:///E|/LEC/LECTUR17/NODE8.HTM (2 of 13) [19/1/2003 1:34:46] Searching in a Binary Tree
- Page 865 and 866: Lecture 3 - recurrence relations
- Page 867 and 868: Lecture 3 - recurrence relations Li
- Page 869 and 870: Lecture 3 - recurrence relations Su
- Page 871 and 872: Lecture 3 - recurrence relations A
- Page 873 and 874: Lecture 4 - heapsort Note iteration
- Page 875 and 876: Lecture 4 - heapsort The convex hul
- Page 877 and 878: Lecture 4 - heapsort 1. All leaves
- Page 879 and 880: Lecture 4 - heapsort left = 2i righ
- Page 881 and 882: Lecture 4 - heapsort Since this sum
- Page 883 and 884: Lecture 4 - heapsort Selection sort
- Page 885 and 886: Lecture 4 - heapsort Greedy Algorit
- Page 887 and 888: Lecture 5 - quicksort Partitioning
- Page 889 and 890: Lecture 5 - quicksort Listen To Par
- Page 891 and 892: Lecture 5 - quicksort Listen To Par
- Page 893 and 894: Lecture 5 - quicksort The worst cas
- Page 895 and 896: Lecture 5 - quicksort Mon Jun 2 09:
- Page 897 and 898: Lecture 6 - linear sorting Since 2i
- Page 899 and 900: Lecture 6 - linear sorting With uni
- Page 901 and 902: Lecture 6 - linear sorting Listen T
- Page 903 and 904: Lecture 7 - elementary data structu
- Page 905 and 906: Lecture 7 - elementary data structu
- Page 907 and 908: Lecture 7 - elementary data structu
- Page 909 and 910: Lecture 7 - elementary data structu
- Page 911 and 912: Lecture 7 - elementary data structu
- Page 913 and 914: Lecture 7 - elementary data structu
- Page 915: Lecture 7 - elementary data structu
- Page 919 and 920: Lecture 8 - binary trees TREE-MINIM
- Page 921 and 922: Lecture 8 - binary trees Inorder-Tr
- Page 923 and 924: Lecture 8 - binary trees Listen To
- Page 925 and 926: Lecture 8 - binary trees insert(b)
- Page 927 and 928: Lecture 8 - binary trees Not (1) -
- Page 929 and 930: Lecture 9 - catch up Next: Lecture
- Page 931 and 932: Lecture 10 - tree restructuring 1.
- Page 933 and 934: Lecture 10 - tree restructuring Lis
- Page 935 and 936: Lecture 10 - tree restructuring Not
- Page 937 and 938: Lecture 10 - tree restructuring Cas
- Page 939 and 940: Lecture 11 - backtracking Next: Lec
- Page 941 and 942: Lecture 11 - backtracking Only 63 s
- Page 943 and 944: Lecture 11 - backtracking Recursion
- Page 945 and 946: Lecture 11 - backtracking Specifica
- Page 947 and 948: Lecture 12 - introduction to dynami
- Page 949 and 950: Lecture 12 - introduction to dynami
- Page 951 and 952: Lecture 12 - introduction to dynami
- Page 953 and 954: Lecture 12 - introduction to dynami
- Page 955 and 956: Lecture 12 - introduction to dynami
- Page 957 and 958: Lecture 13 - dynamic programming ap
- Page 959 and 960: Lecture 13 - dynamic programming ap
- Page 961 and 962: Lecture 13 - dynamic programming ap
- Page 963 and 964: Lecture 14 - data structures for gr
- Page 965 and 966: Lecture 14 - data structures for gr
Lecture 8 - binary trees<br />
- Joyce Kilmer<br />
Binary search trees provide a data structure which efficiently supports all six dictionary operations.<br />
A binary tree is a rooted tree where each node contains at most two children.<br />
Each child can be identified as either a left or right child.<br />
A binary tree can be implemented where each node has left and right pointer fields, an (optional) parent pointer, and a data<br />
field.<br />
Listen To Part 8-4<br />
Binary Search Trees<br />
A binary search tree labels each node in a binary tree with a single key such that for any node x, and nodes in the left subtree<br />
of x have keys and all nodes in the right subtree of x have key's .<br />
Left: A binary search tree. Right: A heap but not a binary search tree.<br />
<strong>The</strong> search tree labeling enables us to find where any key is. Start at the root - if that is not the one we want, search either left<br />
or right depending upon whether what we want is or then the root.<br />
Listen To Part 8-5<br />
Dictionary search operations are easy in binary trees ...<br />
TREE-SEARCH(x, k)<br />
file:///E|/LEC/LECTUR17/NODE8.HTM (2 of 13) [19/1/2003 1:34:46]<br />
Searching in a Binary Tree