sort([ [30,100], [10,11] ], X).
gets
X = [[10,11],[30,100]]
How can I sort only by the first index of each sublist?
i.e
X = [[10,100], [30, 11]]
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The below is my untested code.. there may be one/two cosmetic errors… The input list is split into two based on the head value on the list and the resulted two lists are recursively processed to finally result the sorted output.
Try this and let me know…