Computer Knowledge

Data Structures and Algorithms

1,518 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. Linear data structure

  2. Complex data structure

  3. Non-linear data structure

  4. Simple data structure

  5. None of the above

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

An array is a linear data structure.

Multiple choice
  1. Stack

  2. Queue

  3. Tree

  4. Linked List

  5. De-queue

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

A stack is a LIFO data-structure. LIFO stands for Last In First Out. The element which enters last, is the first to get out of the stack.

Multiple choice
  1. The sort-merge join

  2. The nested loops join

  3. This depends on some sort parameter values

  4. This depends on the number of rows in each table

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

When OPTIMIZER_MODE is set to FIRST_ROWS, Oracle's cost-based optimizer prioritizes returning the first rows quickly rather than minimizing total resource usage. A nested loops join is typically preferred over sort-merge join in FIRST_ROWS mode because it can start returning rows immediately without waiting for the entire sorting operation to complete, making it more responsive for interactive queries.

Multiple choice
  1. Linear search is slow as compared to binary search.

  2. Linear search requires sorted data.

  3. Linear search is not efficient with large data.

  4. The complexity of binary search is O(log n).

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

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

Yes, these statements are true.

Multiple choice
  1. Quick sort requires additional memory as compared to merge sort.

  2. The average case complexity of merge sort is the same as quick sort.

  3. The worst case complexity of quick sort and merge sort are also the same.

  4. All of the above

  5. Only (2) and (3).

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

Both have the same complexity O(N log N), where N is the number of comparisons.

Multiple choice
  1. B Tree can be used in database.

  2. In B+ Tree, the root may be either leaf or an internal node with two or more children.

  3. In B Tree of order m, every node has at most m children.

  4. Both (2) and (3).

  5. (1), (2) and (3) all are true.

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

This is the correct choice.

Multiple choice
  1. TreeSet class ensures that the elements will be sorted in the natural ascending order.

  2. HashSet class does not maintain the order of the elements.

  3. HashSet ensures that the elements have no duplicacy.

  4. Both (2) and (3).

  5. (1), (2) and (3) all are true.

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

Correct choice

Multiple choice
  1. Prints: false,false,false

  2. Prints: false,false,true

  3. Prints: false,true,false

  4. Prints: true,false,false

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

The Vector.elements method returns an Enumeration over the elements of the vector. Vector implements the List interface and extends AbstractList so it is also possible to get an Iterator over a Vector by invoking the iterator or listIteratormethod.