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

PLEASE ANSWER THE 3 QUESTIONS CORRECTLY 1) Consider this function declaration: v

ID: 3581214 • Letter: P

Question

PLEASE ANSWER THE 3 QUESTIONS CORRECTLY

1) Consider this function declaration:

void quiz(int i)

{

if (i > 1)

{

quiz(i / 2);

quiz(i / 2);

}

cout << "*";

}

How many asterisks are printed by the function call quiz(5)?


      
A) 3

      
B) 4

      
C) 7

      
D) 8


2) What additional requirement is placed on an array, so that binary search may be used to locate an entry?

      
A) The array must have at least 2 entries.

      
B) The array elements must form a tree.

      
C) The array's size must be a power of two.

      
D) The array must be sorted.


3) In an open-address hash table there is a difference between those spots which have never been used and those spots which have previously been used but no longer contain an item. Which function has a better implementation because of this difference?

      
A) size

      
B) insert

      
C) is_present

      
D) remove

      
E) Two or more of the above functions

Explanation / Answer

1) seven (7)

2) The array must be sorted. In Binary search array should be sorted.

3) E

These are the answers to the above solutions.

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