<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div class="post-text">
<p>Hello, </p><p><br></p><p> I am just a total beginner in mercury and finding it hard to
solve this problem. I want to convert a list to a list of tupples sorted
from smaller to higher frequenties. Eg:</p>
<pre><code>string.to_char_list("this is a test") becomes
[{'a', 1}, {'e', 1}, {'h', 1}, {'i', 2}, {' ', 3}, {'s', 3}, {'t', 3}]
OR
[3,2,1,2,1,1,2] becomes
[{3, 1}, {1, 3}, {2, 3}]
</code></pre>
<p>You can see that the list of tuples are sorted from smaller to higher frequenties.</p>
<p>I am asking if someone can help me to solve this or point me to a tutorial where i can find more tips to do it.</p><p><br></p>
<p>Thanks for your reply.</p></div></td></tr></table><br>