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

(6) Which data structure is used by the compiler to implement function calls? (a

ID: 3801997 • Letter: #

Question

(6) Which data structure is used by the compiler to implement function calls?
(a) vector (b) stack (c) two dimensional array (d) list
(7) Which of the following statements about stacks is incorrect?
(a) stacks can be implemented using linked lists.
(b) stacks are first in, first-out data structures.
(c) new nodes should be added to the top of the linked list based stack.
(d) the last node (the bottom) of a linked list based stack has a null (zero) link.
(8) An integer stack S is initially empty, then, the following commands are performed.
S.push(8);
S.push(7);
S.pop();
S.push(9);
S.push(8);
S.pop();
Which of the following is the correct stack after the commands (assume the top of the stack is on the
left).
(a) 8 9 7 8 (b) 8 9
(c) 7 8 (d) 9 8
(9) A deep copy refers to
(a) the copying of values of pointers (b) the copying of basic types, such as integers
(c) the copying of big objects (d) the copying of values of pointees
(10) A shallow copy refers to
(a) the copying of basic types, such as integers (b) the copying of values of pointers
(c) the copying of small objects (d) the copying of values of pointees
(11) C++ istream
(a) is a class (b) is a class object (c) is an operator (d) is a class method
(12) When we define and implement operator overloading in C++:
(a) It must be a class member (b) It may or may not be a class member.
(c) It must not be a member of a class (d) It can not be declared as a friend function.

Explanation / Answer

6.

Stack data structure is used by the compiler to implement function calls.

Otion b

7.

stacks are first in, first-out data structures not correct.

Stacks are Last In First Out structures

Otion b

8.

S.push(8);

S.push(7);
s contain 8 and 7.

S.pop(); 7 deleted from stack. stack contain 8.

S.push(9); stack contain 8 and 9  
S.push(8); stack contain 8,9 and 8

S.pop(); Delete 8 from stack so stack contain 8 and 9

Top of the stack is 9 and next element is 8.

9 8 correct.

Otion d

9.

A deep copy refers to the copying of big objects.

Otion c

10.

A shallow copy refers to the copying of small objects.

Otion c

11.

C++ istream is a class object.

Otion b

12.

It may or may not be a class member it may or may not be a class member.

Otion b