Question: QUESTION 1 A queue is a data structure in which the elements are _ _ _ _ . a . added to and deleted from

QUESTION 1
A queue is a data structure in which the elements are ____.
a.
added to and deleted from the front
b.
added to the rear and deleted from the front
c.
added to and deleted from the rear
d.
added and deleted in the middle
4 points
QUESTION 2
What is the output of the following code?
stackType stack;
int x, y;
x =5;
y =3;
stack.push(4);
stack.push(x);
stack.push(x +1);
y = stack.top();
stack.pop();
stack.push(x + y);
x = stack.top();
stack.pop();
cout <<"x ="<< x << endl;
cout <<"y ="<< y << endl;
a.
x =5
y =3
b.
x =11
y =6
c.
x =4
y =3
d.
x =5
y =6
4 points
QUESTION 3
In the linked implementation of stacks, the memory to store the stack elements is allocated statically.
True
False
4 points
QUESTION 4
Assume the key of the left child below the root node of a binary search tree is 30. The value in the root node could be ____.
a.
0
b.
10
c.
30
d.
40
4 points
QUESTION 5
The sequence of operations in a postorder traversal is ____.
a.
visit; traverse left; traverse right
b.
traverse left; traverse right; visit
c.
traverse left; visit; traverse right
d.
traverse left; traverse right
4 points
QUESTION 6
A stack can be implemented as either a(n)____ or a linked structure.
a.
queue
b.
map
c.
array
d.
struct
4 points
QUESTION 7
Which of the following is listed in the chapter as a basic operation performed on a queue?
a.
top
b.
pop
c.
push
d.
isEmptyQueue
4 points
QUESTION 8
A binary tree has a special node called the ____ node.
a.
root
b.
rootleaf
c.
superparent
d.
super
4 points
QUESTION 9
After deleting the desired item from a binary search tree, the resulting tree must be a binary search tree.
True
False
4 points
QUESTION 10
Consider that A is a binary tree, C and D are the subtrees of A. Which of the following statements is always true?
a.
C and D are empty trees.
b.
C and D are binary trees.
c.
C and D are search binary trees.
d.
A is empty.

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!