JAVA DATA STRUCTURES FINAL
EXAM
The end at which the insertions and deletions occur in a stack is called the ____ of the
stack. - Correct Answers -top
In the Reverse Polish notation, the operators are written before the operands. - Correct
Answers -False
In a stack, the ____ operation adds an element onto the stack. - Correct Answers -push
The method ____ from the Java class Stack returns and removes the top element of the
stack. - Correct Answers -pop
The push method of the stack can be compared with the method ____ for a general list.
- Correct Answers -insertFirst
Physical simulators include wind tunnels used to experiment with the design of car
bodies. - Correct Answers -true
A stack is also called a ____data structure. - Correct Answers -LIFO
As in a stack, the middle elements of the queue are inaccessible, even if the queue
elements are stored in an array. - Correct Answers -false
Simulating the behavior of an expensive or dangerous experiment using a computer
model is usually more expensive than using the real system. - Correct Answers -false
In a queuing system, the term ____represents the time it takes to serve a customer. -
Correct Answers -transaction time
In a queuing system, when a server becomes free, the customer at the rear of the
queue moves to the free server to be served. - Correct Answers -false
You can use stacks to convert recursive algorithms into nonrecursive algorithms. -
Correct Answers -true
Adding or pushing an element onto the stack is a two-step process. - Correct Answers -
true
, Elements are deleted from a queue at one end, called the ____. - Correct Answers -
front
The ____ method from the interface QueueADT adds a new element to the rear of the
queue. - Correct Answers -addQueue
An array is a random access data structure; that is, you can directly access any element
of the array. - Correct Answers -TRue
A technique in which one system models the behavior of another system is called ____.
- Correct Answers -simulation
The method isFullQueue from the interface QueueADT initializes the queue to an empty
state. - Correct Answers -false
Adding an element to a full stack would generate an error or exception called ____. -
Correct Answers -stack overflow exception
Postfix or Reverse Polish notation has the advantage that the operators appear in the
order required for computation. - Correct Answers -true
What are the two steps in pushing a value onto a stack? - Correct Answers -First, you
must determine if there
is room on the stack for another value. If there is, you push the value onto the stack;
otherwise, you don't.
A ____list is a linked list in which every node has a next pointer and a back pointer. -
Correct Answers -doubly linked
If first points to the first node in a list and first is ____, the list is empty. - Correct
Answers -null
One of the basic operations performed on a list is to process each node of the list. -
Correct Answers -True
An unordered list can be built in two ways: in the forward manner and in the backward
manner. - Correct Answers -true
A doubly linked list can be traversed in either direction. - Correct Answers -true
When building an unordered list in the forward manner, you need ____ reference
variables. - Correct Answers -3
When building an unordered list in the backward manner, a new node is always inserted
at the end of the linked list. - Correct Answers -false
EXAM
The end at which the insertions and deletions occur in a stack is called the ____ of the
stack. - Correct Answers -top
In the Reverse Polish notation, the operators are written before the operands. - Correct
Answers -False
In a stack, the ____ operation adds an element onto the stack. - Correct Answers -push
The method ____ from the Java class Stack returns and removes the top element of the
stack. - Correct Answers -pop
The push method of the stack can be compared with the method ____ for a general list.
- Correct Answers -insertFirst
Physical simulators include wind tunnels used to experiment with the design of car
bodies. - Correct Answers -true
A stack is also called a ____data structure. - Correct Answers -LIFO
As in a stack, the middle elements of the queue are inaccessible, even if the queue
elements are stored in an array. - Correct Answers -false
Simulating the behavior of an expensive or dangerous experiment using a computer
model is usually more expensive than using the real system. - Correct Answers -false
In a queuing system, the term ____represents the time it takes to serve a customer. -
Correct Answers -transaction time
In a queuing system, when a server becomes free, the customer at the rear of the
queue moves to the free server to be served. - Correct Answers -false
You can use stacks to convert recursive algorithms into nonrecursive algorithms. -
Correct Answers -true
Adding or pushing an element onto the stack is a two-step process. - Correct Answers -
true
, Elements are deleted from a queue at one end, called the ____. - Correct Answers -
front
The ____ method from the interface QueueADT adds a new element to the rear of the
queue. - Correct Answers -addQueue
An array is a random access data structure; that is, you can directly access any element
of the array. - Correct Answers -TRue
A technique in which one system models the behavior of another system is called ____.
- Correct Answers -simulation
The method isFullQueue from the interface QueueADT initializes the queue to an empty
state. - Correct Answers -false
Adding an element to a full stack would generate an error or exception called ____. -
Correct Answers -stack overflow exception
Postfix or Reverse Polish notation has the advantage that the operators appear in the
order required for computation. - Correct Answers -true
What are the two steps in pushing a value onto a stack? - Correct Answers -First, you
must determine if there
is room on the stack for another value. If there is, you push the value onto the stack;
otherwise, you don't.
A ____list is a linked list in which every node has a next pointer and a back pointer. -
Correct Answers -doubly linked
If first points to the first node in a list and first is ____, the list is empty. - Correct
Answers -null
One of the basic operations performed on a list is to process each node of the list. -
Correct Answers -True
An unordered list can be built in two ways: in the forward manner and in the backward
manner. - Correct Answers -true
A doubly linked list can be traversed in either direction. - Correct Answers -true
When building an unordered list in the forward manner, you need ____ reference
variables. - Correct Answers -3
When building an unordered list in the backward manner, a new node is always inserted
at the end of the linked list. - Correct Answers -false