Question: Suppose you are designing a system for buying and selling stocks using a continuous limit order book strategy, as described in the beginning of this
Suppose you are designing a system for buying and selling stocks using a continuous limit order book strategy, as described in the beginning of this chapter. Describe how to use priority queues to process such buy and sell orders, including those that can be processed immediately and those that have some or all of their shares needing to wait until some future match to be processed. You don’t need to list all pending buy and sell orders, but you do need to always display the pending buy order(s) with the highest and lowest prices and the pending order(s) with the highest and lowest prices. You may assume that buy and sell orders are never cancelled and remain in the system until they are matched. Describe a system that can process buy and sell orders in amortized O(log n) time, where n is the number of orders in the system.
Step by Step Solution
3.41 Rating (167 Votes )
There are 3 Steps involved in it
Place the order at the market Market orders are transactions meant to execute as quickly as possible at the current market price Place the order at the limit Limit orders set the maximum or minimum pr... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2036_61d6ac34259e4_835274.pdf
180 KBs PDF File
2036_61d6ac34259e4_835274.docx
120 KBs Word File
