title: Sorting an ArrayList of mixed integers and strings while preserving relative ordering of strings and integers
body: <p>Consider an arraylist as given below</p>
  
  <pre><code>unsortedList = {6,"ball",3,1,"apple","cat",4} 
  </code></pre>
  
  <p>this needs to be sorted to</p>
  
  <pre><code>sortedList = {1,"apple",3,4,"ball","cat",6}
  </code></pre>
  
  <p>Sort the strings alphabetically. Sort the numbers in ascending.  But note the following condition:</p>
  
  <ul>
  <li>Wherever an integer is there in the unsorted list, it must be an integer in the sorted list.</li>
  <li>Wherever a string is there in the unsorted list, it must be a string in the sorted list.</li>
  </ul>
  
  <p>Notice that in the above example, all the integers are sorted ascending and all the strings are sorted ascending, but the relative positions of integers and strings is unchanged from before.</p>