Question: Question 41 If an array has n elements, then the last index is ________. A. n B. n-1 C. n+1 D. None of the above.
Question 41
If an array has n elements, then the last index is ________.
A. n
B. n-1
C. n+1
D. None of the above.
Question 42
An array is a sequence of variables of the same data type.
True OR False
Question 43
Unless we run out of memory, we can insert in a linked list.
True OR False
Question 44 A node (of a linked list) typically has ________ .
A. 2 attributes: data and the location of the next node
B. 1 attribute only: data
C. 1 attribute only: the location of the next node
D. None of the above.
Question 45
In an empty list based stack, sp is null.
True OR False
Question 46
A stack is what category of data structure?
A. Last In Last Out
B. Last In First Out
C. First In First Out
D. None of the above.
Question 47
If we know in advance the maximum number of items we will ever have in a stack, then we can use an array to represent the stack.
True OR False
Question 48
A queue is a FIFO data structure.
True OR False
Question 49
In a queue represented by an array, and a count field, how do we tell if the queue is empty or full?
A. By the position of the front and rear indices.
B. By the count of elements in the queue.
C. If the front and rear pointers are equal.
D. None of the above.
Question 50
A recursive method can be a value-returning method.
True OR False
Question 51
The idea of recursion is to ________ the size of the problem at each step so that we eventually reach an easy-to-solve problem (base case).
Fill in the blank.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
