How to sort disorder list of numbers in scheme
问题 What it the proper way to sort a list with values in Scheme? For example I have the values which are not ordered: x1, x5, x32 .... xn or 3, 4, 1, 3, 4, .. 9 First I want to for them by increase number and display them in this order: x1, xn, x2, xn-1 or 1, 6, 2, 5, 3, 4 Any help will be valuable. 回答1: This is the same question you posted before, but with a small twist. As I told you in the comments of my answer, you just have to sort the list before rearranging it. Here's a Racket solution: