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. O(n2)

  2. O(nlogn)

  3. O(logn)

  4. O(n)

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

Merge sort consistently performs at O(nlogn) time complexity in all cases - best, average, and worst. The algorithm divides the array log n times and merges n elements at each level, giving nlog n total operations.

Multiple choice
  1. O(n2)

  2. O(nlogn)

  3. O(logn)

  4. O(n)

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

Bubble sort has O(n²) average time complexity because in the average case, it requires multiple passes through the array. For n elements, it makes approximately n²/2 comparisons and swaps in the average scenario.

Multiple choice
  1. array([key=>] value,.......)

  2. array)key=>value,.........)

  3. Both (1) and (2)

  4. None of these

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

PHP arrays are created using array() with optional key-value pairs: array('key' => 'value', 'key2' => 'value2'). The => operator associates keys with values. Modern PHP also supports the shorter [] syntax.

Multiple choice
  1. Arrays

  2. Stacks

  3. Queues

  4. Trees

  5. Lists

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

This is the data structure in system software which organises the symbol table in such a way that it is having two link fields LEFT and RIGHT to each record where the left link points to the left records and right link points to the right records.