CS 121 Lecture Notes - Lecture 81: Binary Tree

100 views3 pages
Non-Linear Data Structures:
Trees: a non-linear data structure that consists of a root node & potentially
many levels of additional nodes that form a hierarchy.
oInternal Nodes: all nodes other than the root.
oLeaf Nodes: nodes that have no children.
The tree is drawn “upside down” w/ the root at the top & the
leaves at the bottom.
oIn a general tree, each node could have many child nodes.
The inheritance relationships among classes can be depicted
using a general tree structure.
oIn a binary tree, each node can have no more than 2 child nodes.
Binary trees are useful in various programming situations & usually
easier to implement than general trees.
Technically, binary trees are a subset of general trees.
oThe operations on trees & binary trees vary, but minimally include adding
& removing nodes from the tree or binary tree.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Trees: a non-linear data structure that consists of a root node & potentially many levels of additional nodes that form a hierarchy: internal nodes: all nodes other than the root, leaf nodes: nodes that have no children. The tree is drawn upside down w/ the root at the top & the leaves at the bottom: in a general tree, each node could have many child nodes. The inheritance relationships among classes can be depicted using a general tree structure: in a binary tree, each node can have no more than 2 child nodes. Binary trees are useful in various programming situations & usually easier to implement than general trees. Technically, binary trees are a subset of general trees: the operations on trees & binary trees vary, but minimally include adding. & removing nodes from the tree or binary tree. B/c of their non-linear nature, trees & binary trees are implemented nicely using references as dynamic links.

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