COMPSCI 61B Lecture Notes - Lecture 21: Binary Tree, Binary Search Tree, Linked List

36 views3 pages

Document Summary

Fundamental problem with ordered linked list: slow get, containskey, and put. Change entry point, ip links: move pointer to middle build a bst. A set of edges that connects those nodes. There is only one path between any two nodes. In a rooted tree, we call one node the root. Every node n except the root has one parent ( rst node on the path from n to the root) A node with no child is a leaf. In a rooted binary tree, every node has 0, 1, or 2 children (subtrees) A binary search tree is a rooted binary tree with the bst property: for every node x in the tree, Every key in the left subtree is less than x"s key. Every key in the right subtree is greater than x"s key. Exactly one of p < q and q < p is true p < q and q < r imply p < r.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents