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. the list is empty or has exactly one element

  2. the elements in the list are sorted in non-decreasing order of data value

  3. the elements in the list are sorted in non-increasing order of data value

  4. not all elements in the list have the same data value

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

Multiple choice
  1. L is necessarily finite

  2. L is regular but not necessarily finite

  3. L is context free but not necessarily regular

  4. L is recursive but not necessarily context free

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

Since L can be effectively enumerated so L has to be regular, but is doesn't mean that the decisions are finite.

Multiple choice
  1. L is recursive

  2. L is recursively enumerable but not recursive

  3. L is not recursively enumerable

  4. Whether L is recursive or not will be known after we find out if P = NP

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

A language L is said to be recursive if there exists any rule to determine whether an element belong to language or not, if language can be accepted by turning machine. So there exist the rules so L is recursive.

Multiple choice
  1. Takes O (3n) and $\Omega$(2n) time if hashing is permitted
  2. Takes O (n3) and $\Omega$ (n2.5) time in the key comparison model
  3. Takes $\odot$ (n3) time and space
  4. Takes O ($\sqrt{n}$) time only if the sum of the 2n elements is an even number
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Multiple choice
  1. 2.4 ns

  2. 2.3 ns

  3. 1.8 ns

  4. 1.7 ns

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

Multiple choice
  1. 2.4 ns

  2. 2.3 ns

  3. 1.8 ns

  4. 1.7 ns

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

Multiple choice
  1. 0

  2. $\dfrac{1}{16}$
  3. $\dfrac{1}{8}$
  4. 16

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

Multiple choice
  1. only (i)

  2. only (ii)

  3. either (i) or (ii) but not both

  4. neither (i) nor (ii)

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

Multiple choice
  1. 1, 3, 5, 6, 8, 9

  2. 9, 6, 3, 1, 8, 5

  3. 9, 3, 6, 8, 5, 1

  4. 9, 5, 6, 8, 3, 1

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

the all its children

Multiple choice
  1. 10, 7, 9, 8, 3, 1, 5, 2, 6, 4

  2. 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

  3. 10, 9, 4, 5, 7, 6, 8, 2, 1, 3

  4. 10, 8, 6, 9, 7, 2, 3, 4, 1, 5

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