Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Foundations
Quiz 14: Introduction to Collections and Stacks
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Essay
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.
Question 22
Short Answer
What is the fundamental difference between radix sort and the other sorting techniques that have been studies.
Question 23
True/False
In a circular array-based implementation of a queue, the elements must all be shifted when the dequeue operation is called.
Question 24
Essay
What is wrong with implementing a queue via an array where index 0 represents the front of the queue?
Question 25
True/False
A radix sort is a comparison-based sorting algorithm.
Question 26
Essay
Suppose the following sequence of elements are inserted into a stack and a queue in the following order: 50, 26, 32, 18, 26, 51. What is the result of three pop operations of the stack and three dequeue operations of the queue?
Question 27
Short Answer
List the five basic operations on a queue.
Question 28
Essay
What is wrong with the java.util.Stack implementation of a stack?
Question 29
True/False
The peek operation on a stack returns a reference to the element at the bottom of the stack.
Question 30
True/False
It is possible to implement a stack and a queue in such a way that all operations take a constant amount of time.
Question 31
Essay
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.
Question 32
Short Answer
Write out the order of elements that are contained in a queue after the following operations are performed.
Question 33
True/False
In a linked implementation of a stack, a pushed element should be added to the end of the list.
Question 34
Essay
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).