title: How do I efficiently search this hierarchical structure?
body: <p>I have a data structure that looks like this:</p>
  
  <pre><code>public class Node
  {
       public string Code { get; set; }
       public string Description { get; set; }
       ...
       public List&lt;Node&gt; Children { get; set; }
  }
  </code></pre>
  
  <p>I want to write a method that will return a specific node, given the specified <code>Code</code>.  Normally I would just do a recursive walk through the hierarchy to find the node, but I'm concerned about performance.  There will be several thousand nodes in the hierarchy, and this method will be called many, many times.</p>
  
  <p>How do I structure this to make it faster?  Can I use an existing data structure that perhaps performs a binary search on <code>Code</code> while retaining the hierarchical structure, without re-implementing some form of binary search myself?</p>