Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 704 Bytes

module05-quiz.md

File metadata and controls

31 lines (25 loc) · 704 Bytes

Module 5: Stacks and Queues

Topics Covered:

  • Stack and Queue operations
  • String problems using stacks
  • Monotonic stacks

Key Problems:

  • Simplify Path
  • Moving Average from Data Stream
  • Next Greater Element I

Quiz:

  1. What is the main principle of a stack?

    • a) First In, First Out (FIFO)
    • b) Last In, First Out (LIFO)
    • c) Random Access
    • d) Sorting
  2. What is the time complexity of adding an element to a queue?

    • a) O(n)
    • b) O(log n)
    • c) O(1)
    • d) O(n^2)
  3. Which problem can be efficiently solved using a monotonic stack?

    • a) Sorting an array
    • b) Finding the next greater element
    • c) Calculating prefix sums
    • d) Reversing a linked list