Java Reference
In-Depth Information
SR 13.12
A stack is a linear data structure that adds (pushes) and removes
(pops) nodes from one end. It manages information using a last-in,
first-out (LIFO) approach.
SR 13.13
The contents of the stack from top to bottom are: 37 72 5
SR 13.14
The Stack class is defined in the java.util package of the Java stan-
dard class library. It implements a generic stack ADT. The Stack class
stores Object references, so the stack can be used to store any kind of
object.
13.4 Non-Linear Data Structures
SR 13.15
Trees and graphs are both non-linear data structures, meaning that the
data they store is not organized in a linear fashion. Trees create a hier-
archy of nodes. The nodes in a graph are connected using general edges.
SR 13.16
a. tree, b. graph, c. graph, d. tree
13.5 The Java Collections API
SR 13.17
The Java Collections API is a set of classes in the Java standard class
library that represents collections of various types, such as ArrayList
and LinkedList .
SR 13.18
A generic type is a collection object that is implemented such that
the type of objects it manages can be established when the collection
is created. This allows some compile-time control over the types of
objects that are added to the collection and eliminates the need to cast
the objects when they are removed from the collection. All collections
in the Java Collections API have been implemented as generic types.
Search WWH ::




Custom Search