Exam 14: Introduction to Collections and Stacks
Exam 1: Introduction40 Questions
Exam 2: Data and Expressions40 Questions
Exam 3: Using Classes and Objects40 Questions
Exam 4: Conditionals and Loops40 Questions
Exam 5: Writing Classes40 Questions
Exam 6: Graphical User Interfaces40 Questions
Exam 7: Arrays40 Questions
Exam 8: Inheritance40 Questions
Exam 9: Polymorphism39 Questions
Exam 11: Recursion40 Questions
Exam 10: Exceptions40 Questions
Exam 12: Searching and Sorting40 Questions
Exam 13: Trees40 Questions
Exam 14: Introduction to Collections and Stacks40 Questions
Exam 15: Heaps and Priority Queues40 Questions
Exam 16: Graphs40 Questions
Select questions type
What is the result of evaluating the following postfix expression: 4 8 + 2 *
Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
B
In a radix sort, the radix refers to __________________________ .
Free
(Multiple Choice)
4.7/5
(45)
Correct Answer:
C
In a circular array-based implementation of a queue, the elements must all be shifted when the dequeue operation is called.
Free
(True/False)
4.8/5
(40)
Correct Answer:
False
It is only possible to implement a stack using a linked structure.
(True/False)
4.8/5
(36)
In an array-based implementation of a stack, which end of the contents of the array represents the bottom of the stack and why?
(Essay)
4.9/5
(34)
In a array-based implementation of a queue that stores the front of the queue at index 0 in the array, the dequeue operation is ___________________.
(Multiple Choice)
4.7/5
(36)
A queue is the ideal collection to use when ____________________ .
(Multiple Choice)
4.9/5
(35)
A queue is helpful in implementing a __________________ sort.
(Multiple Choice)
4.8/5
(38)
Write out the order of elements that are contained in a queue after the following operations are performed.


(Short Answer)
4.9/5
(32)
Write an enqueue method for a queue implemented as a linked structure. You may assume that the class has references to LinearNode<T> objects called front and rear, which represent the front and rear of the queue respectively. You may also assume that the class has a variable called count, which represents the number of elements in the queue.
(Essay)
4.8/5
(35)
Explain how a queue can be implemented using an array, where the enqueue and the dequeue operations are both constant time operations (for simplicity, we'll assume we will never need to expand the capacity of the array).
(Essay)
4.9/5
(27)
Write an enqueue method for a queue implemented as a circular array. You may assume that you have access to a method called expandCapacity that will double the size of the array if necessary. The class has instance variables front and rear, which represent the indexes of the front and rear of the queue. It also has an integer variable called count that represents the number of elements in the queue, as well as an array of generic T types called queue that represents the queue.
(Essay)
4.9/5
(43)
Write a push method for a stack implemented as a linked structure. You may assume that the implementation has the top element of the stack referenced by a LinearNode<T> reference top and that an integer variable count keeps track of the number of elements in the stack.
(Essay)
4.9/5
(40)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)