Question: QUESTION 13 bool search( Node *ptr, Bird & bird, Bird dove ) { if ( ptr == NULL ) return false; if ( ptr->info ==

QUESTION 13

bool search( Node *ptr, Bird & bird, Bird dove )

{

if ( ptr == NULL )

return false;

if ( ptr->info == dove ) {

bird = ptr->info;

return true;

}

return search( ptr->next, bird, dove );

}

In the above code, Recursion will stop if there is a dove in the list, due to lines

3-8

5-8

9

3-4

QUESTION 14

A ___________ is an empty node at the top of a tree

root header

NULL node

header

root

myClass

QUESTION 15

In the array implementation of the stack, top is decremented in the pop function because:

top records the number of elements in the stack, and the number of elements decreases by one on a pop

otherwise, there would be no way to access the array position that needs popped

it is an index to the current top of the stack, and that index decreases by one on a pop

None of the above

it stores the value of the current top of the stack, and a value lower in the stack is always less

QUESTION 16

Templates may be used to make available a very large collection of _____.

files

programs

none of the above. C++ doesn't support templates.

functions

classes

QUESTION 17

A linked list implementation of a list is more difficult to implement than the linked list implementation of a stack or queue because

we may need to remove any node

we may need to retrieve any node.

All of the Above

we may need to replace any node

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!