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. link/cut tree

  2. AVL tree

  3. T-tree

  4. splay tree

  5. finger tree

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

Multiple choice
  1. A red–black tree is used to organize pieces of comparable data.

  2. All leaves (NIL) are black.

  3. Pre-order traversal of a red-black tree gives data in sorted order.

  4. Every red node must have two black child nodes.

  5. Red–black trees are particularly valuable in functional programming.

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

Red–black trees, like all binary search trees, allow efficient in-order traversal (that is: in the order Left–Root–Right) of their elements. The search-time results from the traversal from root to leaf, and therefore a balanced tree of n nodes, having the least possible tree height, results in O(log n) search time.

Multiple choice
  1. The array list must be short in size.

  2. The array list must be arranged in descending order.

  3. The array list must be arranged in increasing order.

  4. The array list must have numbers in random order.

  5. The array list must be very lengthy.

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

This is the most essential condition required for performing binary search as correct values of pointers; Low, Mid and High can only be provided when the list is in increasing order.

Multiple choice
  1. Arrays are small in size.

  2. Arrays are very big in size.

  3. Arrays are static structures.

  4. Arrays are dynamic structures.

  5. Arrays are easier to implement.

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

This is the greatest disadvantage as once the size of the arrays is specified it remains fixed until the user changes it.