Lecture 20
Trees
- Trees. Examples: genealogical trees; the Unix file system; a
few Unix features: root directory, navigation using .. and
~account, symbolic links (shortcuts).
- Mathematical versus Computer Science point of view on
trees. Trees as connected graphs without cycles. Rooted trees.
- Binary trees.
- Implementation of binary trees. The binary tree node: data,
left and right. Binary tree abstract data
type.
- Applications: Binary arithmetic expression trees and Binary
search trees.
- Binary arithmetic expresion trees. From a fully parenthesized expression
to a binary expression tree to an arithmetic expression in
postfix form.
- Definition of binary search trees.
- Application of binary tree traversal for search trees: Sorting using
binary search trees.
- Tree traversal algorithms, sketch. Left node Right, Left
Right node traversals.
- Start designing the BTree class. Discussion, in class: how to
implement the node; what are the class variables and methods.
Ileana Streinu