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. Equal to height of the tree

  2. Constant

  3. Number of nodes in the heap

  4. None of these

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

In a binary heap, decreasing a key may require 'bubbling up' the node to maintain the heap property. This process takes time proportional to the height of the tree, which is O(log n).

Multiple choice
  1. Infix to postfix conversion

  2. Infix to prefix conversion

  3. Postfix evaluation

  4. None of these

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

Multipop is often used in the analysis of stack operations or specific algorithms like postfix evaluation where multiple operands need to be popped to perform an operation.

Multiple choice
  1. Rear =1, Front = 1

  2. Rear = 1, Front = 7

  3. Rear = 1, Front = 2

  4. Queue overflows

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

Initial: Rear=2, Front=6. Size is 3 (A, B, C). Insert(X), Insert(Y): Rear=4. Remove(): Front=7. Insert(Z), Insert(D), Insert(E): Rear=7. The queue is full.

Multiple choice
  1. to avoid overflow

  2. an index entry is not created for every value

  3. the entry contains the search key and a pointer in the first data record with that search key value

  4. None of these

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

In this, index entry is not created for every value. Each index entry contains a search-key and a pointer to the first record with that search-key value.

Multiple choice
  1. a list of keys

  2. pointers to the master list

  3. both (1) and (2)

  4. none of above

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

An index is a data structure that improves the speed of data retrieval. It contains a list of keys and pointers to the actual records in the master list.

Multiple choice
  1. last in first out order

  2. first in first out order

  3. parallel fashion

  4. any one of the above

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

Recursive functions rely on the call stack to manage function invocations. Since the stack follows a last in first out (LIFO) structure, the most recently called function must complete before returning to the previous caller.