Practice test for Data Structure and Algorithm
Question 1
pts
Select all of the statements that are true regarding the structure of an Array List.
All of the elements are located contiguously in memory.
The heights of the two child sub-trees of any node can differ by at most one.
It uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be
found or stored.
The key at the root node has the minimum key value among all nodes.
All of the elements are of the same type.
It is a linear ordered collection of values called elements.
The last node in the sequence contains a pointer (or reference) to the first node in the sequence.
The values are stored and removed to satisfy the property that an element with high priority is served before an
element with low priority.
Each node has an extra bit of data that is used to ensure the structure remains approximately balanced during
insertions and deletions.
Question 2
pts
Select all of the statements that are true regarding the structure of an Array.
The values are stored and removed to satisfy first-in-first-out (FIFO) access property.
,It has a variable size.
All of the elements are of the same type.
It uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be
found or stored.
It is a linear ordered collection of values called elements.
The key at the root node has the minimum key value among all nodes.
It includes a set of edges that connect pairs of nodes.
The last node in the sequence contains a pointer (or reference) to the first node in the sequence.
It has a fixed size.
Question 3
pts
Select all of the statements that are true regarding the structure of a Directed Graph.
The key at the root node has the maximum key value among all nodes.
There may be cycles (circular references) in the structure.
Each node has an extra bit of data that is used to ensure the structure remains approximately balanced during
insertions and deletions.
Its edges are one-directional.
,The values are stored and removed to satisfy first-in-first-out (FIFO) access property.
If y is a node in the right subtree of node x, then y.key >= x.key.
It includes a set of edges that connect pairs of nodes.
Its edges each include a weight value.
The key of any node has a value <= all key values in its sub-trees
Question 4
pts
Select all of the statements that are true regarding the structure of a Graph.
It is a collection of nodes called vertices.
The key of any node has a value <= all key values in its sub-trees
There may be cycles (circular references) in the structure.
The heights of the two child sub-trees of any node can differ by at most one.
It includes a set of edges that connect pairs of nodes.
Each node has either two children and one data element or three children and two data elements.
The values are stored and removed to satisfy first-in-first-out (FIFO) access property.
If y is a node in the right subtree of node x, then y.key >= x.key.
, If y is a node in the left subtree of node x, then y.key <= x.key.
Question 5
pts
Select all of the statements that are true regarding the structure of a Weighted Graph.
The last node in the sequence contains a pointer (or reference) to the first node in the sequence.
It uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be
found or stored.
The key of any node has a value >= all key values in its sub-trees
The key of any node has a value <= all key values in its sub-trees
The heights of the two child sub-trees of any node can differ by at most one.
It is a collection of nodes called vertices.
Each node has either two children and one data element or three children and two data elements.
It includes a set of edges that connect pairs of nodes.
Its edges each include a weight value.
Question 6
pts
Select all of the statements that are true regarding the structure of a Hash Table.
Each node has an extra bit of data that is used to ensure the structure remains approximately balanced during
insertions and deletions.