Data Structures & Algorithms MCQs — Programming

3 practice MCQs

The correct answer is marked on every question, with its full explanation.

ProgrammingData Structures & Algorithms PPSC FPSC NTSID: NWF-035

In a stack data structure, which element is removed first?

  1. AThe last element added. ✓ Correct answer
  2. BThe first element added.
  3. CThe middle element.
  4. DA random element.
ProgrammingData Structures & Algorithms PPSC FPSC NTSID: PROG-003

Which data structure works on the first-in, first-out rule?

  1. AStack
  2. BTree
  3. CQueue ✓ Correct answer
  4. DGraph
ProgrammingData Structures & Algorithms PPSC FPSC NTSID: PROG-008

Which sorting method repeatedly swaps neighbouring elements that are in the wrong order?

  1. ABubble sort ✓ Correct answer
  2. BMerge sort
  3. CQuick sort
  4. DInsertion sort

Practise these MCQs interactively →

← Programming MCQs