(1) In the derived class, which data members of the base class are visible? (a)
ID: 3770594 • Letter: #
Question
(1) In the derived class, which data members of the base class are visible?
(a) those in the public section only
(b) those in the protected section only
(c) those in the public or protected sections
(d) those in the public or private sections
(2) Which of the following data structures requires more than constant average time for an insertion (push)?
(a) queue
(b) stack
(c) STL set
(d) array.
(3) Which of the following data structures yields an efficient sort?
(a) queue
(b) stack
(c) STL set
(d) array.
(4) The following routine violates which rule(s) of recursion?
bool recurse( int n )
{
if ( n ==1)
return recurse(1);
else
return recurse( n-1)+ n;
}
(a) No base case
(b) No recursive case
(c) None of the above
(d) Two of the above
(5) What happens when wraparound is implemented for a queue?
(a) If front advances past the last array position, it is reset to the first array position.
(b) If rear advances past the last array position, it is reset to the first array position.
(c) Both (a) and (b)
(d) Neither (a) nor (b)
Explanation / Answer
(c) those in the public or protected sections
(c) STL set
(c) STL set
(a) No base case
(b) If rear advances past the last array position, it is reset to the first array position.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.