Exam 4: Linked Structures - Stacks

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

What are the advantages of the java.util.Stack implementation of a stack?

Free
(Essay)
4.8/5
(38)
Correct Answer:
Verified

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:
Verified

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:
Verified

Automatic Garbage Collection

What is the principle difference in behavior between a stack and a queue?

(Multiple Choice)
4.8/5
(41)

What is abstraction and what advantage does it provide?

(Essay)
4.9/5
(30)

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)

What is a data type?

(Short Answer)
4.9/5
(25)

The order in which references are changed is crucial to maintaining a linked list.

(True/False)
4.8/5
(36)

Stacks operate as _______________.

(Multiple Choice)
4.9/5
(39)

What are the 3 primary methods for a stack?_______

(Short Answer)
4.8/5
(38)

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)

A linked list is ____ where as an array is ______.

(Short Answer)
4.9/5
(38)

Elements in a collection are typically organized by

(Multiple Choice)
4.8/5
(43)

What is an abstract data type?

(Essay)
4.8/5
(35)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)