Building Java Programs - University of Washington
Building Java Programs
Binary Trees reading: 17.1 ? 17.3
2
Trees
? tree: A directed, acyclic structure of linked nodes.
? directed : Has one-way links between nodes. ? acyclic : No path wraps back around to the same node twice.
binary tree: One where each node has at most two children.
root
? Recursive definition: A tree is either:
? empty (null), or
1
? a root node that contains:
? data, ? a left subtree, and
2
3
? a right subtree.
? (The left and/or right subtree could be empty.)
45
67
3
Trees in computer science
? TreeMap and TreeSet implementations
? folders/files on a computer
? family genealogy; organizational charts
? AI: decision trees
=
? compilers: parse tree
? a = (b + c) * d;
a
*
? cell phone T9
+
d
b
c
4
Terminology
? node: an object containing a data value and left/right children
? root: topmost node of a tree
? leaf: a node that has no children
? branch: any internal node; neither the root nor a leaf root
? parent: a node that refers to this one
height = 3
? child: a node that this node refers to
1 level 1
? sibling: a node with a common parent
? subtree: the smaller tree of nodes on level 2 2
the left or right of the current node
? height: length of the longest path
from the root to any node
4 level 3
5
? level or depth: length of the path
from a root to a given node
3 67
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- building java programs university of washington
- binarysearch int a int key method example
- using recursion to convert number to other number bases
- lab a translating data to binary york university
- identifying java calls in native code via binary scanning
- binarysearch double a int fromindex int toindex
- the binaryreader and binarywriter java transformations
- binarysearch char a int fromindex int toindex
- networking with java university of arizona
- insert percolate up heap insert val university of washington
Related searches
- university of washington hr jobs
- university of washington jobs listing
- university of washington human resources
- university of washington human resources dept
- university of washington baseball roster
- university of washington product management
- university of washington online mba
- university of washington printable map
- university of washington opioid taper
- university of washington opioid calculator
- university of washington program management
- university of washington graduate programs