Back to Question
Design a Data Structure for Stock Prices (Heaps)
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
Click "Start Speaking" and answer the question naturally.