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
Write a push method for a stack implemented with an array. You may assume that the stack is referenced by an array named stack, and that there is an integer variable named count that keeps track of the number of elements in the stack. You may not assume that you have access to an expandCapacity method (meaning that your method should include code to expand the capacity of the array if it is full).
(Essay)
4.9/5
(37)
It is possible to implement a stack and a queue in such a way that all operations take a constant amount of time.
(True/False)
4.7/5
(36)
Which of the following methods removes an element from a queue?
(Multiple Choice)
4.9/5
(44)
Which of the following methods inserts an element into a stack data structure?
(Multiple Choice)
4.8/5
(39)
What is wrong with implementing a queue via an array where index 0 represents the front of the queue?
(Essay)
4.9/5
(31)
Suppose there were no count variable stored for the linked implementation of a queue. Would it still be possible to implement a constant time size operation? How about if there were no count variable stored for an array based implementation of a queue?
(Essay)
4.7/5
(41)
What exception is thrown if the pop method is called on an empty stack?
(Multiple Choice)
4.7/5
(32)
Write out the order of elements that are contained in a stack after the following operations are performed.


(Short Answer)
4.9/5
(32)
It is only possible to implement a queue using an array-based structure.
(True/False)
4.8/5
(35)
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?
(Essay)
4.8/5
(37)
What is the fundamental difference between radix sort and the other sorting techniques that have been studies.
(Short Answer)
4.9/5
(35)
In an ideal implementations of a stack and a queue, all operations are ______________________ .
(Multiple Choice)
4.8/5
(36)
The peek operation on a stack returns a reference to the element at the bottom of the stack.
(True/False)
4.9/5
(34)
In a linked implementation of a stack, a pushed element should be added to the end of the list.
(True/False)
4.7/5
(34)
A stack is the ideal collection to use when _______________________ .
(Multiple Choice)
4.9/5
(38)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)