COSC 2320 Chapter Notes - Chapter 35 - 37: Tree Traversal, Binary Search Tree, Binary Tree

77 views2 pages

Document Summary

Ch. 35: binary trees: binary tree each node has up to two children. If key is less: assign current node to the left repeat. If key is more: assign current node to the right, repeat. Chapter 37: binary search tree: bst insert algorithm. Insert inserts the new node in a proper location obeying the bst ordering property. If new node"s key is less than current node and current node"s left child is 0: assigns that node"s left child with the new node. If new node"s key is greater than the current node and the current node"s right child is 0: assigns the node"s right child with the new node, search for insert location. If x has a parent: the parent"s left/right child pointing to x is assigned with 0. If x is the root: assign root pointer with 0, remove internal node with single child. X"s single child: the parent"s left/right child pointing to x is assigned with.

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