Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.22 KB

module12-quiz.md

File metadata and controls

42 lines (33 loc) · 1.22 KB

Module 12: Bonus Topics

In this module, we will cover additional topics that include difference arrays, tries, bit manipulation, and Dijkstra’s Algorithm.

Topics Covered

  • Difference arrays
  • Tries
  • Bit manipulation
  • Dijkstra’s Algorithm

Key Problems

  • Hamming Distance
  • Cheapest Flights Within K Stops
  • Implement Trie
  • Insert Interval

Quiz

  1. What is a trie used for?

    • A) Storing strings in a space-efficient manner
    • B) Searching for words
    • C) Both A and B
  2. In Dijkstra's algorithm, what is the main strategy?

    • A) To find the shortest path in a graph
    • B) To sort the graph
    • C) To minimize the number of edges
  3. What is the Hamming Distance?

    • A) The number of positions at which two strings of equal length differ
    • B) The number of common characters between two strings
    • C) The sum of characters in two strings
  4. What is the time complexity of inserting a string into a trie?

    • A) O(n)
    • B) O(m)
    • C) O(n * m), where n is the number of strings and m is the length of the longest string
  5. How do you calculate the cheapest flights within K stops?

    • A) By using dynamic programming
    • B) By using breadth-first search (BFS)
    • C) By using depth-first search (DFS)