KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: May

Course Name: C++                    Lesson Name: Chap 18.1.2.3b

Student Name

Password


Objective
To complete the workbook exercises.


Primary Focus
Match the columns below.

Site Links
Course Home Page
Binary Tree diagram

Additional Resources
Use the following for questions 10-15

B E I L P Q R T W Y

Site Links


What is the output of the program below?
int main()
{
cout « recurfunction(5);
return 0;
AYes it will count up.
If the recurfunction ( ) function is passed the value 8, how many times will the recursive function call itself?
BA sequential search
Will the recursive function work properly if it is passed a negative number? Explain your answer.
C4
What does recurfunction( ) return if it is passed the value 10?
D10
What does recurfunction ( ) return if it is passed the value 9?
E0
What is the simplest type of search to implement?
F35
Why does a binary search require that the elements be sorted?
G9
Is a binary search algorithm a good candidate for a recursion function? Why or why not?
Htwice
If the item for which you are searching is at the end of a lO-element array, how many comparisons must be made to find it using a sequential search?
IYes and they are much simpler. In fact, the algorithm is generally more common
If the item for which you are searching is at the end of a lO-element array, how many comparisons must be made to find it using a binary search?
JA binary search
What type of search begins by comparing the first element of the array with the value which is being sought?
K15
Using a sequential search, how many comparisons must be made to find the item T?
L2047
Using a binary search, how many comparisons must be made to find the item T?
MThe search must know what half of the list to continue searching, and what half to discard.
What type of search (sequential or binary) will find the item E in the fewest comparisons?
N8
What type of search (sequential or binary) will find the item W in the fewest comparisons?
O2
What is the maximum number of nodes possible in a four-level binary tree?
PDifferent numbers could have the same remainder
What is the maximum number of nodes possible in an eleven-level binary tree?
Q21,16,13,14,19,17,39,27,22,45,51
How is a search of a binary tree similar to the binary search described in the previous section?
RAfter each comparison, half of the list can be discarded
When using the division-remainder method of hashing, what could be one cause of a collision?
S13,14,16,17,19,21,22,27,39,45,51
What makes searching a binary tree so efficient?
T both searches depend on the list or tree being in some type of order.
Using the binary tree shown in the link at the top of this page,What would be the result of an in-order traversal of the tree?
U14,13,17,19,16,22,27,51,45,39,21
Using the binary tree shown in the link at the top of this page,What would be the result of a preorder traversal of the tree?
V
Using the binary tree shown in the link at the top of this page,What would be the result of a postorder traversal of the tree?
W