Give a stream of stock prices, design a data structure to support the following operations:
StockSticker(int k)Initialize the size of the ticker.void addOrUpdate(String stock, double price)add or update the price of a stock to the data structure.List<Map.Entry<String, double>> top()return the top k price stocks and their current prices.
Comments (18)

