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. n = d1d2......dm−i and rev = dm dm−1......dm−i+1

  2. n = dm−i+1.....dm−1 dm or rev = dm−i .....d2d1

  3. n $\ne$ rev
  4. n = d1d2....dm or rev = dm......d2d1

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

Multiple choice
  1. (top 1= MAXSIZE/2) and (top 2 = MAXSIZE/.2+1)

  2. top 1+ top2=MAXSIZE

  3. (top 1= MAXSIZE/2) or (top2 = MAXSIZE)

  4. top 1= top 2−1

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

Multiple choice
  1. 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95

  2. 9, 10, 15, 22, 40, 50, 60, 95, 23, 25, 27, 29

  3. 29, 15, 9, 10, 25, 22, 23, 27, 40, 60, 50, 95

  4. 95, 50, 60, 40, 27, 23, 22, 25, 10, 0, 15, 29

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

When we are given any no elements & even any order (preorder or post order) & we need to calculate in order, then in order is simply sorted sequence of the elements. Here 9, 10, 15, 22, 23, 25, 27, 29, 40, 50, 60, 95

Multiple choice
  1. An array of 50 numbers

  2. An array of 100 numbers

  3. An array of 500 numbers

  4. A dynamically allocated array of 550 numbers

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

Here the no. readable are range 0 to 100 but the output of the program is interested in scores above 50 so there are 50 values (51 to 100) in this range. So only an array 50 integers required as we get any no. we increment the value stored at index.Array [x − 50] by

Multiple choice
  1. 8 and 0

  2. 128 and 6

  3. 256 and 4

  4. 512 and 5

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

Multiple choice
  1. 2

  2. 3

  3. 4

  4. 5

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

Multiple choice
  1. Database relations have a large number of records.

  2. Database relations are sorted on the primary key.

  3. B+-trees require less memory than binary search trees.

  4. Data transfer from disks is in blocks.

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

B+ tree's each node size is kept almost the same to the block size of the system. This causes record data transfer from disk to memory one block at a time.

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. The complement of a recursive language is recursive.

  2. The complement of a recursively enumerable language is recursively enumerable.

  3. The complement of a recursive language is either recursive or recursively enumerable.

  4. The complement of a context-free language is context-free.

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

A recursive language has complement & its complement is also recursive. Whereas complement of others is not recursive