Back to QuestionsPractice with This Question
Design a Data Structure for Stock Prices (Heaps)
109.2K views•Asked at Netflix•
Medium
Question Explain
Design a data structure that allows you to record the latest stock price and retrieve the maximum, minimum, and current price in $O(1)$ time. Use two heaps and a hash map.
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.