how to MERGE sorted values together with the name that comes together with the value?
<pre><code>for (a = 0; a &lt; filename; a++) {
    Map&lt;Double,String&gt; m = new HashMap&lt;Double,String&gt;();

    String pre = "abc";
    String post = ".txt";
    for (int ii = 0; ii &lt; 11; ii++) {
        m.put(similarityScore[a],pre + a + post + '\n');
    }
    SortedSet&lt;Double&gt; set = new TreeSet&lt;Double&gt;(m.keySet());
    for (Double d : set) {
        System.out.println(d + " " + m.get(d));
    }
    }
</code></pre>

<p>Example output : </p>

<pre><code>The resulting similarity score of the query how [INITIAL OUTPUT]

abc0.txt = 0.5773502691896258

abc1.txt = 0.5773502691896258

abc2.txt = 0.5773502691896258

abc3.txt = NaN

abc4.txt = 0.5773502691896258

abc5.txt = NaN

abc6.txt = NaN

abc7.txt = NaN

abc8.txt = NaN

abc9.txt = 0.5773502691896258

abc10.txt = NaN

Similarity score sorted **DESIRED** output :


0.5773502691896258   abc0.txt

0.5773502691896258   abc1.txt

0.5773502691896258   abc2.txt

0.5773502691896258   abc4.txt

0.5773502691896258   abc9.txt

NaN                  abc3.txt

NaN                  abc5.txt

NaN                  abc6.txt

NaN                  abc7.txt

NaN                  abc8.txt

NaN                  abc10.txt
</code></pre>

<p>How do i make the text files to merge with the similarity score even ofter sorted ? In another sense, even after sorting, the output display each individual text file follow their individual score. </p>
