Exam 21: Stacks and Queues
Exam 1: Introduction to Computers and Java42 Questions
Exam 2: Java Fundamentals53 Questions
Exam 3: Decision Structures52 Questions
Exam 4: Loops and Files48 Questions
Exam 5: Methods50 Questions
Exam 6: A First Look at Classes49 Questions
Exam 7: A First Look at Gui Applications49 Questions
Exam 8: Arrays and the Arraylist Class52 Questions
Exam 9: A Second Look at Classes and Objects40 Questions
Exam 10: Text Processing and More About Wrapper Classes49 Questions
Exam 11: Inheritance49 Questions
Exam 12: Exceptions and Advanced File Io46 Questions
Exam 13: Advanced Gui Applications46 Questions
Exam 14: Applets and More39 Questions
Exam 15: Recursion34 Questions
Exam 16: Sorting, Searching, and Algorithm Analysis46 Questions
Exam 17: Generics50 Questions
Exam 18: Collections50 Questions
Exam 19: Array-Based Lists20 Questions
Exam 20: Linked Lists36 Questions
Exam 21: Stacks and Queues36 Questions
Exam 22: Binary Trees, Avl Trees, and Priority Queues45 Questions
Select questions type
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 testing whether the stack is empty is
(Multiple Choice)
4.9/5
(39)
A stream of cars going through a toll booth is an example of a
(Multiple Choice)
4.8/5
(43)
Consider a class that uses the following variables to implement an array-based stack:
String [ ] s = new String[100];
Int top = 0;
The boolean method to check for an empty stack can be written as:
(Multiple Choice)
4.9/5
(45)
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 pop()operation can be written as
(Multiple Choice)
4.8/5
(40)
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 void push(String x)operation can be written as
(Multiple Choice)
4.8/5
(33)
In a list implementation of a queue,the end of the list at which elements are added is called
(Multiple Choice)
5.0/5
(39)
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 operation void push(String x)can be written as
(Multiple Choice)
4.7/5
(28)
In a queue implementation that uses an array of fixed size,
(Multiple Choice)
4.7/5
(35)
Which of the following operations is not a stack operation?
(Multiple Choice)
4.8/5
(44)
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,rear;
What is the right code for a constructor for such a linked list class?
(Multiple Choice)
4.9/5
(36)
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 void add(String x)operation? Such an operation adds x to the queue
(Multiple Choice)
4.8/5
(33)
Showing 21 - 36 of 36
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)