| What is the output of the program below?
int main()
{
cout « recurfunction(5);
return 0;
| A | Yes it will count up.
|
| If the recurfunction ( ) function is passed the value 8, how many times will the recursive function call itself?
| B | A sequential search
|
| Will the recursive function work properly if it is passed a negative number? Explain your answer.
| C | 4
|
| What does recurfunction( ) return if it is passed the value 10?
| D | 10
|
| What does recurfunction ( ) return if it is passed the value 9?
| E | 0
|
| What is the simplest type of search to implement?
| F | 35
|
| Why does a binary search require that the elements be sorted?
| G | 9
|
| Is a binary search algorithm a good candidate for a recursion function? Why or why not?
| H | twice
|
| 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?
| I | Yes 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?
| J | A binary search
|
| What type of search begins by comparing the first element of the array with the value which is being sought?
| K | 15
|
| Using a sequential search, how many comparisons must be made to find the item T?
| L | 2047
|
| Using a binary search, how many comparisons must be made to find the item T?
| M | The 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?
| N | 8
|
| What type of search (sequential or binary) will find the item W in the fewest comparisons?
| O | 2
|
| What is the maximum number of nodes possible in a four-level binary tree?
| P | Different numbers could have the same remainder
|
| What is the maximum number of nodes possible in an eleven-level binary tree?
| Q | 21,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?
| R | After 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?
| S | 13,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?
| U | 14,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 | |