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:
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}]
You can see that all the list of tuples are sorted from smaller to higher frequenties.
I am asking if someone can help me to slove it or a pointer to a tutorial where i can find more tips to do it.
Thanks for your reply.