title: How to make and use sorted list of objects (containing 2 integers, list should be sorted by one of them)
body: <p>I've seen in visual studio (c#) something like SortedList. However, I don't know how does it work and how to use it. I want to use SortedList because I hope it has got fastest access time than a normal list. Unfortunately, I can't use array. I'd be glad to see some simple example.</p>
  
  <p>edit:
  Let's say there's an object class:</p>
  
  <pre><code>class Point
  {
  public Point(int a, int b) {x = a; y = b;}
  int x;
  int y;
  }
  
  // x value will not be repeating in a list
  Point a1 = new Point(1,2);
  Point a2 = new Point(3,5);
  Point a3 = new Point(0,2);
  Point a4 = new Point(2,7);
  Point a5 = new Point(14,2);
  Point a6 = new Point(9,10);
  
  SortedList&lt;Point&gt; list = new SortedList&lt;Point&gt;();
  
  list.Add(a1);
  list.Add(a2);
  list.Add(a3);
  list.Add(a4);
  list.Add(a5);
  list.Add(a6);
  </code></pre>
  
  <p>Is it possible to add all those elements in O(log2n) time? I'd like my list after adding this to look like that. Without being forced to sort it over again after sort.</p>
  
  <pre><code>(0,2)
  (1,2)
  (2,7)
  (3,5)
  (9,10)
  (14,2)
  </code></pre>
  
  <p>And then I'd like to check, wheter there's an object with (x == 9). Would that be possible in O(log2n) time?</p>
  
  <p>Thanks</p>