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. Double-ended queue is an abstract data type.

  2. In double-ended queue, elements can be added to or removed from either the front or back end.

  3. Double-ended queue is also called deque.

  4. All of the above

  5. Only (1) and (3) are true.

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

Yes, all are true statements about the double-ended queue.

Multiple choice
  1. Only 1 and 2

  2. Only 1

  3. Only 2 and 3

  4. Only 2

  5. 1, 2 and 3

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

Statement 1 is true, whereas statement 2 is false as linked list size can be varied dynamically where as array size cannot. Statement 3 is also false as it is very easy to insert or remove elements from the linked list.

Multiple choice
  1. Both 1 and 2

  2. Only 1

  3. Only 2

  4. Only 2 and 3

  5. 1, 2 and 3

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

Statements 1 and 2 are true because the time complexity for searching an element in binary search tree is O(log n) and the time complexity for searching an element in binary tree is O(n). Statement 3 is false as time complexity for searching an element in binary tree and binary search tree can be determined.

Multiple choice
  1. C B A D

  2. B C D A

  3. A D B C

  4. A D C B

  5. None of these

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

yes of the given time complexities the one with time O(log log n) is smallest because logarithm of a number is significantly small, here we are applying another logarithm which makes it much smaller, the next smaller will be O(log n) followed by O(n) and O(1) which makes it B C D A

Multiple choice
  1. Descending order of inserted elements

  2. Random order of inserted elements

  3. Ascending order of inserted elements

  4. The order in which the elements are inserted

  5. None of the above

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

yes in order traversal of binary search tree gives ascending order of inserted elements. the in order pattern is as followsleft->root->right. So when we traverse it goes to the last element in the left sub tree and display it and then its root and its right sibling. this pattern is applied recursively.

Multiple choice
  1. Symbol table construction

  2. Spell checker

  3. Auto complete feature

  4. Implementing recursion

  5. None of these

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

yes, to implement a symbol table a tree data structure is necessary.A symbol- table mechanism must allow us to add new entries and find existing entries efficiently so a tree data structure is best suited

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.