CSSE 230: Session Notes - Day 4
Topics
- Trees
- Binary Trees
- Binary search trees
- The Comparable interface
- Inserting into a BST
Outline
- [5 min] Definition of trees:
Nodes, edges, directed edges, root, leaves, height and depth.
- [2 min] Definition of a binary tree.
- [3 min] Definition of a Binary Search
Tree (BST)
- [3 min] Motivation of the use of trees in CS.
- [5 min] Heights and depths of nodes in a tree.
- [15 min] The Comparable
interface and how to properly set it up.
- [10 min] Implementing trees: BinarySearchTree class with inner
BinaryNode class.
- [5 min] Break
- [15 min] Group discussion: How to insert into a BST? What should
the return type be?
- [Balance of time] Work on binary
search trees project.
Resources