title: Efficient way of sorting a List<Point> by X value
body: <p>I am doing some sort operation and the data structure that I am using is a <code>List&lt;Point&gt;</code>.</p>
  
  <p>Now this Point has two values <code>x</code> and <code>y</code>, and the values are given not in a sorted manner.</p>
  
  <p>I have to sort this <code>List&lt;Point&gt;</code> in an efficient way according to the value of x, either increasing x or decreasing x.</p>
  
  <p>One solution can be a brute force approach of parsing through each value and comparing that value to all the other to find the smallest in each iteration but that will be an inefficient approach.</p>
  
  <p>What other solution can be used for this problem.</p>
  
  <p>Edit : Point is from <a href="http://docs.opencv.org/java/2.4.2/org/opencv/core/package-summary.html" rel="nofollow noreferrer"><code>org.opencv.core</code></a> package.</p>