Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 13 bool search( Node *ptr, Bird & bird, Bird dove ) { if ( ptr == NULL

ID: 3715409 • Letter: Q

Question

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

Explanation / Answer

here are the answers highlighted in bold..

================================================================

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

===============================================================

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote