Computer Knowledge

Data Structures and Algorithms

1,256 Questions

Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.

Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity

Data Structures and Algorithms Questions

Multiple choice
  1. B-tree

  2. Hash table

  3. Dequeue

  4. Set

  5. Bitmap

Reveal answer Fill a bubble to check yourself
B Correct answer
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.

Multiple choice
  1. Circular buffer

  2. Bitmap

  3. Graph

  4. Tagged union

  5. Container

Reveal answer Fill a bubble to check yourself
C Correct answer
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.

Multiple choice
  1. Tree

  2. Stack

  3. Queue

  4. String

  5. Set

Reveal answer Fill a bubble to check yourself
C Correct answer
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.

Multiple choice
  1. Simple linked list

  2. BST

  3. B+ tree

  4. Hash table

  5. AVL tree

Reveal answer Fill a bubble to check yourself
C Correct answer
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.

Multiple choice
  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.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

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

Multiple choice
  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.

Reveal answer Fill a bubble to check yourself
D Correct answer
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.

Multiple choice
  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.

Reveal answer Fill a bubble to check yourself
D Correct answer
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.

Multiple choice
  1. Little Omega Notation

  2. Theta Notaion

  3. Recursive Algorithm

  4. Probabilistics Algorithm

  5. Greedy Algorithm

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

It is an algorithm which calls itself with smaller inputs and obtains the outputs for the current input by applying simple operaions to the returned value of the smaller input.