Computer Knowledge

Data Structures and Algorithms

1,518 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. Red–black tree

  2. AVL tree

  3. Splay tree

  4. T-tree

  5. B-Tree

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

A splay tree is a self-adjusting binary search tree with the additional property that recently accessed elements are quick to access again. It performs basic operations such as insertion, look-up and removal in O(log n) amortized time. For many sequences of non-random operations, splay trees perform better than other search trees, even when the specific pattern of the sequence is unknown.

Multiple choice
  1. Use case

  2. Performance engineering

  3. Algorithmic efficiency

  4. Profiling

  5. Performance testing

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

Profiling is a form of dynamic program analysis that measures, for example, the space or time complexity of a program, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.

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.