QUESTION1 A stack will be initialized with top = 0 and data[i] = null with i = 0
ID: 3754637 • Letter: Q
Question
QUESTION1
A stack will be initialized with top = 0 and data[i] = null with i = 0 to size
True
False
QUESTION 2
In the queue structure, the node is inserted at front and is removed at rear
True
False
QUESTION 3
Give an efficient circular array-based queue Q capable of holding 10 objects.
After the following code is executed:
for (int k = 1; k <= 7; k++ ) Q.enqueue(k);
for (int n = 1; n <=7; n++ ) Q.enqueue (Q.dequeue());
The result on the queue as follows:
0
1
2
3
4
5
6
7
8
9
4
5
6
7
1
2
3
True
False
QUESTION 4
The queue is initialized with the top = -1 and data[ i ] = null where i = 0 to size
True
False
QUESTION 5
Enqueue each letter of the word "Welcome" to the queue then print out the result of dequeue each letter from the queue will get the same word "Welcome
True
False
QUESTION 6
They are the operations that perform on the Stack structures
A.
Enqueue, Dequeue
B.
Pop, push
C.
Insert, Delete, Fetch and Update
D.
Add, Remove, get, set
QUESTION 7
Which of the following stack operations could result in stack underflow?
A.
is_empty
B.
pop
C.
pusht
D.
two or more of the above answers
QUESTION 8
Which of the following access modes cannot be used to access restricted structures?
A.
Update
B.
Fetch
C.
Insert
D.
None
QUESTION 9
Nodes A, B and C are placed on a stack in the order first A, then B and finally C, if invoking pop method on this stack, which node will be popped
A.
Node A
B.
Node B
C.
Node C
D.
You need to determine which node to pop
QUESTION 10
onsider the following pseudocode:
declare a stack of characters
while ( there are more characters in the word to read )
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{
write the stack's top character to the screen
pop a character off the stack
}
What is written to the screen for the input "carpets"?
A.
serc
B.
carpets
C.
steprac
D.
ccaarrppeettss
QUESTION 11
The speed of Enqueue operation of Queue structure is:
A.
O(n)
B.
O(nlog2n)
C.
O(1)
D.
O(n2)
QUESTION 12
Describe the ability of Peek operation on the classical Model of a stack
A.
The ability to test for a full stack
B.
The ability to store an “unlimited” number of nodes on the stack
C.
The ability to pop a node from the stack without deleting it from the structure
D.
It is not a operation of the classical Model of a stack
QUESTION 13
Tell what of the following does the acronyms FIFO describes for:
A.
Stack
B.
Queue
C.
Hashtable
D.
none
QUESTION 14
The speed of Pop operation of Stack structure is:
A.
O(n)
B.
O(nlog2n)
C.
O(1)
D.
O(n2)
QUESTION 15
In the implementations of the Stack operation presented in this chapter, what does the memory cell top store?
a.
the index of the array where the next push or the next pop will be performed
b.
the index of the array where the last push or the last pop was performed
c.
the index of the array where the next push or the last pop was performed
d.
the index of the array where the last push or the next pop is performed
0
1
2
3
4
5
6
7
8
9
4
5
6
7
1
2
3
Explanation / Answer
Solution:
Note: The first four subparts have been answered as per Chegg guidelines, please repost others.
1)
True
Explanation: Because the data will be inserted always at the top of the stack.
2)
False
Explanation: Since the queue data structure follows first come first serve policy.
3)
True
4)
False
5)
True
6)
B
7)
B pop
8)
Fetch
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)