I have procedure in scheme which give me a list of pairs and I need to sort descending this list by the second element of the pairs. Like this:
((1 . 1) (2 . 3) (3 . 2)) --> ((2 . 3) (3 . 2) (1 . 1))
((1 . 1) (x . 3) (2 . 1) (3 . 1)) --> ((x . 3) (1 . 1) (2 . 1) (3 . 1))
((1 . 3) (3 . 4) (2 . 2)) --> ((3 . 4) (1 . 3) (2 . 2))
I have no idea how I should use sorting for this.