Upload
irdginfo
View
75
Download
0
Embed Size (px)
Citation preview
Tree
• A set of linked nodes that form a hierarchy• There is a root node at the top• Each node may or may not have children• In some types of trees a node may have any number of
children and in other types the number of children are controlled
• The nodes at the bottom most level are called leaf nodes• The nodes between the root and the leaf nodes are called
internal nodes• A subtree is a portion of a tree that can be viewed as a
complete tree in itself.
Tree
• Traversal– Breadth first• Visit all the nodes at a given level
before going deeper
– Depth first• Visit nodes as deep as possible
first
Trees
• Binary tree– Each node has at most two
children
class
title
instructor
semester
assignment*
title
instructions
grading
student*
name
first
middle?
lastfeedback?
grade?