Math Fundamentals18 sections · 814 units
Open in CourseQuiz: 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?
- A.Time: O(n), Space: O(1)
- B.Time: O(n), Space: O(n)
- C.Time: O(n²), Space: O(n)
- D.Time: O(1), Space: O(n)