How to sort first k elements of an array in Ascending and remaining in descending order in JAVA?
<p>sort first k elements of an array in ascending and remaining in descending order.  </p>

<pre><code>Example :  
Input -  { 9 3 2 8 7 4 1 5 6 }   
for **k = 4**  
Output - { 2 3 8 9 7 6 5 4 1 }
</code></pre>