title: plane coordinate point sorting
body: <p>we have a group of coordinate points (x,y) and they are int.</p>
  
  <p>how can I sort it by x coordinate and then print all the coordinate points.</p>
  
  <p>We use two arrays to store the coordinate points respectively. </p>
  
  <p>That's <code>x[0] x[1]...x[n-1]</code></p>
  
  <pre><code>y[0] y[1]...y[n-1]
  </code></pre>
  
  <p>and (<code>x[0] y[0]) (x[1] y[1])...(x[n-1] y[n-1]</code>) are the coordinate points which we need to sort.</p>
  
  <p>the problem is that when I use a sorting algorithm to sort the array <code>x[0] x[1]...x[n-1]</code>, the result is a new sorted array <code>x[0] x[1]...x[n-1]</code>, and I cannot know the corresponding y in the sorted array <code>x[0] x[1]...x[n-1]</code>.</p>
  
  <p>Please tell me how can I deal with it? Can I use another way to store the coordinate points?</p>