Exam 4: Linked Structures - Stacks
Exam 1: Introduction36 Questions
Exam 2: Analysis of Algorithms31 Questions
Exam 3: Introduction to Collections - Stacks49 Questions
Exam 4: Linked Structures - Stacks51 Questions
Exam 5: Queues28 Questions
Exam 6: Lists42 Questions
Exam 7: Iterators32 Questions
Exam 8: Recursion57 Questions
Exam 9: Searching and Sorting54 Questions
Exam 10: Trees47 Questions
Exam 11: Binary Search Trees50 Questions
Exam 12: Heaps and Priority Queues29 Questions
Exam 13: Sets and Maps47 Questions
Exam 14: Multi-Way Search Trees47 Questions
Exam 15: Graphs29 Questions
Exam 16: UML16 Questions
Exam 17: Object-Oriented Design54 Questions
Select questions type
What are the advantages of the java.util.Stack implementation of a stack?
Free
(Essay)
4.8/5
(38)
Correct Answer:
Because the java.util.Stack implementation is an extension of the Vector class, it can keep track of the positions of elements in the stack using an index and thus does not require each node to store an additional pointer. This implementation also allocates space only as it is needed, like the linked implementation.
Stack elements are processed in a FIFO manner-the first element in is the first element out.
Free
(True/False)
5.0/5
(45)
Correct Answer:
False
When all references to an object are lost and the object can no longer be used, JAVA uses ______ to free up the memory taken up by the unreferenced object.
Free
(Short Answer)
4.9/5
(36)
Correct Answer:
Automatic Garbage Collection
What is the principle difference in behavior between a stack and a queue?
(Multiple Choice)
4.8/5
(41)
A Java interface defines a set of ______ methods and is useful in separating the concept of an abstract data type from its implementation.
(Short Answer)
4.8/5
(36)
______ processing can be simulated using a stack to keep track of the appropriate data.
(Short Answer)
4.7/5
(40)
The order in which references are changed is crucial to maintaining a linked list.
(True/False)
4.8/5
(36)
What would be the time complexity of the push operation if we chose to push at the end of the list instead of the front?
(Essay)
4.9/5
(36)
A ______ can be used to reverse the order of a set of data.
(Multiple Choice)
4.8/5
(35)
When two object references refer to the same object, the references are called ____ of each other.
(Short Answer)
4.7/5
(34)
If an exception occurs during the execution of a java program and is not handled in the method where it occurs, the exception will be ______.
(Short Answer)
5.0/5
(38)
A linked list dynamically grows as needed and essentially has no capacity limitations.
(True/False)
4.9/5
(39)
Explain how a linked list is formed using object reference variables.
(Essay)
4.9/5
(38)
Showing 1 - 20 of 51
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)