
Computer Science II — CSci 1200
Lecture 16 — Trees, Part 1
Test 2 Results
•Average (max of 90): 63.8
•Score ranges:
Range Num Tests
80-87 18
70-79 53
60-69 42
50-59 28
<50 25
•Curve: if sis your raw score out of 90, then your scaled score s0out of 100 is
s0= 1.05s+ 9.54.
•If you believe your test was incorrectly graded, please write a note on the question(s)
and on the front of the exam and resubmit. Your entire exam will be reconsidered.
•Please check all of your on-line grades for correctness. Contact your lab TA to correct
any mistakes.
Today’s Lecture — Binary Tree and Binary Search Trees
•Definition
•Basic operations
•Implementation of cs2set class using binary search trees
Binary Trees and Binary Search Trees
•Trees create a hierarchical organization of data, rather than the linear organization
in linked lists. Trees are a special case of the graphs you investigated in HW 6.
•Binary search trees are the mechanism underlying maps, multimaps, sets and multi-
sets.
•Many other problems can be addressed using trees.
–One example is building data structures to represent spatial information.
Definition: Binary Trees
•A binary tree (strictly speaking, a “rooted binary tree”) is either empty or is a node
that has pointers to two binary trees.