title: Storing Tree Data Structures
body: <p>I have a trinomial tree structure built in vb.net.
  Each node is created as an Object with certain properties.
  These nodes are stored in an ArrayList.
  These ArrayLists are then stored in another ArrayList which would be the tree.</p>
  
  <p>When I run this on say, 4000 steps (i.e. 4000 ArrayLists in my tree), the final ArrayList will have 8001 nodes. The total number of objects is approximately 8000*4000/3 = approx > 10 million nodes.</p>
  
  <p>This is causing the program to crash due to memory overflow.</p>
  
  <p>What is the best method for storing my tree such that it could be made as large as I would like? Is a database or text file the way forward?</p>