Math Fundamentals18 sections · 814 units
Open in Course

Quiz: Space vs Time

(Knowledge check)

Check Your Understanding

An algorithm uses a hash map to store all n input elements and runs a single loop. What are the time and space complexities?

  1. A.Time: O(n), Space: O(1)
  2. B.Time: O(n), Space: O(n)
  3. C.Time: O(n²), Space: O(n)
  4. D.Time: O(1), Space: O(n)
Start the roadmap to answer the quizzes and solve the challenges