Binary Tree Search

advertisement

Search A Binary Tree

You will be supplied with a BYOB project which implements the node of a binary tree. This project contains two parts:

1) Program Implement a predicate block called "Binary Search Tree <Root> Contains <Value>". <Root> is an input into which the root of a binary search tree is passed. <Value> is a number. If any node in the tree contains the number specified by <Value>, then the block returns true. If no node in the tree contains the number specified by <Value>, then it returns false.

2) Lesson Deliver a 30 minute lesson on binary search trees to the class on Dec 17, 2012. The lesson must address the following questions. The presentation should prepare the class for a 10 minute quiz on binary search trees. Example questions of that

Questions to address in the presentation: a.

What is a binary search tree? What does it do? b.

What are advantages and disadvantages of using a binary search tree? a.

When storing new data in the tree? b.

When finding data in the tree? c.

What are alternatives to using a binary search tree?

Example questions for a quiz following the lesson:

What does it mean that a binary search tree is balanced?

Why is 'binary' an applicable name for the structure explained in this lesson?

What is one advantage of storing data in a binary search tree instead of an unordered list?

What is one disadvantage of storing data in a binary search tree instead of an unordered list?

Points

40

Requirement

Program

The block built in part (1) correctly reports whether or not a binary search tree contains a value in 20 test cases. Correct answer from the block will be worth 2 points.

Lesson

The lesson clearly answers all of the questions required by part (2). o Question (a): 8pts o Question (b): 14pts (7 per sub-question) o Question (c): 8pts

Quality of the lesson o The information is communicated clearly (5pts) o The flow of the presentation is easy to follow (5pts)

Preparing the class for the quiz o The quiz following the presentation will be out of 9 points. The score of this section is equal to the class average score on that quiz.

Total

49

89 (B+ at

most)

Download