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. Each node has the maximum of M children and a minimum of M/2 children or any number from 2 to the maximum.

  2. Each node has one fewer keys than children with the maximum of M -1 keys.

  3. Keys are arranged in a defined order within the node.

  4. All the leaves are on the same level, i.e. there is no empty sub tree above the level of the leaves.

  5. All the leaves have been connected to form the linked list of the keys in a sequential order.

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

This is the Property of B-Tree.

Multiple choice
  1. Hash-partitioned global indexes are useful.

  2. Hash-partitioned local indexes are better.

  3. Range-partitioned local indexes are better.

  4. Range-partitioned global indexes are better.

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

Hash-partitioned global indexes distribute index entries evenly across partitions, which prevents contention when many inserts happen at sequence-generated values. Range partitioning would create hot spots because sequential numbers map to adjacent ranges. Local indexes inherit the partitioning scheme of the table, so they don't solve the skew problem.

Multiple choice
  1. LIFO linear data structure

  2. FIFO linear data structure

  3. LIFO non-linear data structure

  4. FIFO non-linear data structure

  5. GIGO non-linear data structure

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

A queue is a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed.. A queue is an example of a linear data structure, or more abstractly a sequential collection.

Multiple choice
  1. Recursive languages are undecidable.

  2. Recursive languages are a recursive subset in the set of all possible words over the alphabet of the language.

  3. Recursive languages are closed under set difference operation.

  4. Recursive languages are closed under complementation.

  5. Recursive languages are closed under union.

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

A formal language is recursive if there exists a total turing machine (a turing machine that halts for every given input) that, when given a finite sequence of symbols from the alphabet of the language as input (any string containing only characters in the language's alphabet) accepts only those that are part of the language and rejects all other strings. Recursive languages are also called decidable.

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.