How to sort the vector of integers by its index?
<p>I want to sort a vector of integers using java comparable or comparator interface. Once the sorting is done i should be able to find its indices as of the before.</p>

<p>I also want to know the differences between the comparable and comparator interface on when to  use what?</p>
