Forums  > Software  > Data Structures for Order Book  
     
Page 1 of 1
Display using:  

Jurassic


Total Posts: 415
Joined: Mar 2018
 
Posted: 2021-04-01 16:59
I want to write a simple order book (in Java) for a toy project. I am trying to think through what is the best way to represent this object in the computer.

I read this https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/ but I dont see why you would use a binary tree?

It seems to be like the best data structure is an array of pointers to heap (ordered by time of order)

Is this correct thinking?

prikolno


Total Posts: 94
Joined: Jul 2018
 
Posted: 2021-04-23 21:18
Self-balancing binary tree is OK for sparse book. Usually the best designs will rely on a mix of domain-specific bounds or book distribution properties to preallocate everything in fixed size arrays and minimize the number of pages moving up the IO hierarchy. You don't want to chase pointers because that is slow.

Previous Thread :: Next Thread 
Page 1 of 1