Services
Discover
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Starting Out with Java
Exam 21: Stacks and Queues
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 1
Multiple Choice
A stack based on a linked list is based on the following code Class Node{ String element; Node next; Node(String el,Node n) { Element = el; Next = n; } } Node top = null; The code for implementing the String pop() operation is
Question 2
Multiple Choice
A queue based on a linked list uses the following code Class Node{ String element; Node next; Node (String el,Node n) { Element = el; Next = n; } } Node front = null,rear = null; What is the right code for String remove() operation? Such an operation removes and returns an element from the queue.
Question 3
Multiple Choice
In a list implementation of a queue,the end of the list from which elements are removed is called
Question 4
Multiple Choice
The stack pull operation
Question 5
Multiple Choice
The stack peek operation
Question 6
Multiple Choice
Consider a class that uses the following variables to implement an array-based stack: String [ ] s = new String[100]; Int top = -1;// Note top == -1 indicates stack is empty A method that implements a String pop() operation can be written as
Question 7
Multiple Choice
A queue is a container that allows elements to be stored and removed
Question 8
Multiple Choice
Consider a class that uses the following variables to implement an array-based stack: String [ ] s = new String[100]; Int top = 0; A method that implements the String peek() operation can be written as
Question 9
Multiple Choice
Consider a class that uses the following variables to implement an array-based stack: String [ ] s = new String[100]; Int top = 0; A method for adding an item x to the stack can be written as
Question 10
Multiple Choice
In an implementation of a stack based on a singly-linked list,it is most efficient to add a new item so that
Question 11
Multiple Choice
A queue based on a linked list uses the following code Class Node{ String element; Node next; Node (String el,Node n) { Element = el; Next = n; } } Node front = null,rear = null; What is the right code for the boolean empty() method?