Data Structures & Algorithms MCQs

20 practice MCQs on this page Page 3 of 4

Tap an option to check your answer — the correct answer and full explanation appear after you choose.

ProgrammingData Structures & Algorithms BPSCID: BPP-2127

When analyzing time complexity which of the following provides an upper bound of run time

  1. ABest case
  2. BAverage case
  3. CWorst case ✓ Correct answer
  4. Dall of them
ProgrammingData Structures & Algorithms BPSCID: BPP-2138

Which of the following describes a "brute force" approach to problem-solving?

  1. AOptimizing each step
  2. BExploring all possible solutions ✓ Correct answer
  3. CUsing domain-specific knowledge
  4. DApplying heuristics
ProgrammingData Structures & Algorithms KPPSCID: KPP-0048

When in-order traversing a tree resulted in E A C K F H D B G; the preorder traversal would return?

  1. AFAEKCDHGB ✓ Correct answer
  2. BFEAKDCHBG
  3. CEAFKHDCBG
  4. DFAEKCDBHG
ProgrammingData Structures & Algorithms KPPSCID: KPP-0052

The time factor when determining the efficiency of the algorithm is measured by:

  1. ACounting the number of key operations ✓ Correct answer
  2. BCounting the number of statements
  3. CCounting the kilobytes of algorithm
  4. DCounting Microseconds
ProgrammingData Structures & Algorithms KPPSCID: KPP-0059

Binary search algorithm cannot be applied to:

  1. APointer Array
  2. BSorted Linked List ✓ Correct answer
  3. CSorted Linear Array
  4. DSorted Binary Trees
ProgrammingData Structures & Algorithms KPPSCID: KPP-0060

Which of the following data structures is a non-linear type?

  1. AStrings
  2. BLists
  3. CGraph ✓ Correct answer
  4. DStacks
ProgrammingData Structures & Algorithms KPPSCID: KPP-0102

Which data structure works on the LIFO principle?

  1. ALinked list
  2. BStack ✓ Correct answer
  3. CArray
  4. DQueue
ProgrammingData Structures & Algorithms KPPSCID: KPP-0138

Which of the following is a sorting algorithm?

  1. ABinary search
  2. BBubble sort ✓ Correct answer
  3. CLinear search
  4. DHashing
ProgrammingData Structures & Algorithms FPSCID: FPP-2367

The FIFO principle is followed by which data structure?

  1. AStack
  2. BQueue ✓ Correct answer
  3. CTree
  4. DGraph
ProgrammingData Structures & Algorithms BPSCID: BPP-2773

Which data structure follows the LIFO principle?

  1. ALinked list
  2. BTree
  3. CQueue
  4. DStack ✓ Correct answer
ProgrammingData Structures & Algorithms BPSCID: BPP-3935

What is the time complexity of linear search in the worst case?

  1. AO(log n)
  2. BO(n²)
  3. CO(1)
  4. DO(n) ✓ Correct answer
ProgrammingData Structures & Algorithms BPSCID: BPP-2777

Which sorting algorithm has the worst-case time complexity O(n^2)?

  1. AQuick sort (best case)
  2. BMerge sort
  3. CBubble sort ✓ Correct answer
  4. DHeap sort
ProgrammingData Structures & Algorithms BPSCID: BPP-2778

Which sorting algorithm has a worst-case time complexity of O(n log n)?

  1. ABubble sort
  2. BInsertion sort
  3. CSelection sort
  4. DMerge sort ✓ Correct answer
ProgrammingData Structures & Algorithms FPSCID: FPP-11401

Which loop is used when the number of iterations is known in advance?

  1. Ado-while loop
  2. Bif statement
  3. Cwhile loop
  4. Dfor loop ✓ Correct answer
ProgrammingData Structures & Algorithms FPSCID: FPP-11405

The binary search algorithm requires the data to be:

  1. AUnsorted
  2. BRandom
  3. CSorted ✓ Correct answer
  4. DReversed
ProgrammingData Structures & Algorithms FPSCID: FPP-11406

Recursion is implemented with the help of which data structure?

  1. AStack ✓ Correct answer
  2. BArray
  3. CQueue
  4. DLinked list
ProgrammingData Structures & Algorithms BPSCID: BPP-3688

In a binary tree, a node with no children is called?

  1. ARoot node
  2. BLeaf node ✓ Correct answer
  3. CParent node
  4. DInternal node
ProgrammingData Structures & Algorithms BPSCID: BPP-3689

Which sorting algorithm has an average-case time complexity of O(n log n)?

  1. ABubble sort
  2. BInsertion sort
  3. CQuick sort ✓ Correct answer
  4. DSelection sort
ProgrammingData Structures & Algorithms BPSCID: BPP-3690

A hash table resolves collisions by which technique?

  1. AChaining ✓ Correct answer
  2. BLinear search
  3. CBinary search
  4. DRecursion
ProgrammingData Structures & Algorithms PPSCID: LTP-7714

A stack data structure follows which order of access?

  1. AFirst In, First Out (FIFO)
  2. BRandom access only
  3. CLast In, First Out (LIFO) ✓ Correct answer
  4. DSmallest first

Practice these MCQs interactively