0

Data Structures

Description: This test covers topics related to data structures.
Number of Questions: 15
Created by:
Tags: Data Structures Data and File Structures
Attempted 0/15 Correct 0 Score 0

Which of the following data structures is usually used in compiler implementations to look up identifiers?

  1. B-tree

  2. Hash table

  3. Dequeue

  4. Set

  5. Bitmap


Correct Option: B
Explanation:

Compiler implementations usually use hash tables to look up identifiers. A hash table (also hash map) is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.

Which of the following is a linked abstract data structure, composed of nodes?

  1. Circular buffer

  2. Bitmap

  3. Graph

  4. Tagged union

  5. Container


Correct Option: C
Explanation:

Graphs and trees are linked abstract data structures composed of nodes. Each node contains a value and also one or more pointers to other nodes. Graphs can be used to represent networks, while trees are generally used for sorting and searching, having their nodes arranged in some relative order based on their values.

Which of the following data structures is not an abstract data type?

  1. Union

  2. Map

  3. Set

  4. Container

  5. Priority queue


Correct Option: A
Explanation:

A union is a value that may have any of several representations or formats, or it is a data structure that consists of a variable which may hold such a value.

Which of the following statements regarding a priority queue is false?

  1. A priority queue is an abstract data type.

  2. A priority queue is a heap.

  3. Priority queuing can be used to manage bandwidth on a transmission line.

  4. A priority queue can be used for implementing Huffman coding.

  5. A priority queue can be used for implementing A* search algorithm.


Correct Option: B
Explanation:

It is a common misconception that a priority queue is a heap. A priority queue is an abstract concept like a list or a map, just as a list can be implemented with a linked list or an array, a priority queue can be implemented with a heap or a variety of other methods.

Which of the following data structures follows this rule? undefined

  1. Tree

  2. Stack

  3. Queue

  4. String

  5. Set


Correct Option: C
Explanation:

A queue is a First In First Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed.

Which of the following is not an application of the tree data structure?

  1. Manipulation of arithmetic expression

  2. Symbol table construction

  3. Syntax analysis

  4. Hierarchical network

  5. Recursion


Correct Option: E
Explanation:

Recursion uses stack data structure.

The network data model majorly uses which of the following data structures?

  1. Set

  2. Linked list

  3. Arrays

  4. Graph

  5. Tree


Correct Option: D
Explanation:

The network data model majorly uses graph data structure.

The technique called 'Quadratic Probing' is generally used with which of the following data structures?

  1. Linked list

  2. B-tree

  3. Hash table

  4. Heap

  5. Queue


Correct Option: C
Explanation:

Quadratic Probing is used for collision resolution in hashing.It is a technique in which the interval between probes is increased by adding the successive outputs of a quadratic polynomial to the starting value given by the original hash computation.

Which of the following data structures is the most efficient for storing data for efficient retrieval in a block-oriented storage context?

  1. Simple linked list

  2. BST

  3. B+ tree

  4. Hash table

  5. AVL tree


Correct Option: C
Explanation:

The primary value of a B+ tree is in storing data for efficient retrieval in a block-oriented storage context — in particular, filesystems. This is primarily because unlike binary search trees, B+ trees have very high fanout (number of pointers to child nodes in a node,typically on the order of 100 or more), which reduces the number of I/O operations required to find an element in the tree.

Which of the following algorithms may use heap as internal traversal data structures?

  1. Bucket sort

  2. Prim's minimal spanning tree

  3. Bubble sort

  4. Shell sort

  5. Comb sort


Correct Option: B
Explanation:

By using heaps as internal traversal data structures, run time will be reduced by polynomial order. Examples of such problems are Prim's minimal spanning tree algorithm and Dijkstra's shortest path problem.

The Breadth First Search algorithm uses which of the following data structures to store intermediate results as it traverses the graph?

  1. Tree

  2. Linked list

  3. Stack

  4. Queue

  5. Set


Correct Option: D
Explanation:

The Breadth First Search algorithm uses a queue data structure to store intermediate results as it traverses the graph.

Which of the following image file formats stores bitmap images in a compressed format?

  1. JPEG

  2. BMP

  3. Netpbm

  4. ILBM

  5. XBM


Correct Option: A
Explanation:

JPEG stores bitmap images in compressed format.

Which of the following statements regarding tree data structure is false?

  1. A tree is a widely used abstract data type (ADT).

  2. A tree can be defined recursively.

  3. A walk in which the children are traversed before their respective parents are traversed is called a pre-order walk.

  4. An external node is any node that does not have child nodes.

  5. A tree is a connected acyclic graph.


Correct Option: C
Explanation:

A walk in which the children are traversed before their respective parents are traversed is called a post-order walk.

Which of the following statements regarding arrays is incorrect?

  1. Arrays can be used to determine control flow in programs.

  2. Arrays are also used to implement other data structures.

  3. Two-dimensional arrays are also called matrices.

  4. The element indices of arrays cannot be computed at run time.

  5. An index maps the array value to a stored object.


Correct Option: D
Explanation:

Arrays are useful mostly because the element indices can be computed at run time. Among other things, this feature allows a single iterative statement to process arbitrarily many elements of an array. For that reason, the elements of an array data structure are required to have the same size and should use the same data representation.

Which of the following statements regarding the stack data structure is false?

  1. Solving the puzzle called Tower of Hanoi implements stacks.

  2. A stack is a restricted data structure.

  3. A stack may be implemented to have a bounded capacity.

  4. A stack is a specific data structure.

  5. Backtracking is an important application of stacks.


Correct Option: D
Explanation:

A stack is a particular kind of abstract data type or collection in which the principal (or only) operations on the collection are the addition of an entity to the collection, known as push and removal of an entity, known as pop.

- Hide questions