
Implement a function that reorders the nodes of a linked list according to a comparator you receive as a parameter.
sort_list([91 -> 34 -> 57], ascending)Expected result
[34 -> 57 -> 91]For your own tracking. Tests grade your code.
ascending(a, b)Expected result
returns non-zero when `a <= b`Expected files
sort_list.cAllowed functions
None. Write every helper yourself.

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement a function that reorders the nodes of a linked list according to a comparator you receive as a parameter.
sort_list([91 -> 34 -> 57], ascending)Expected result
[34 -> 57 -> 91]For your own tracking. Tests grade your code.
ascending(a, b)Expected result
returns non-zero when `a <= b`Expected files
sort_list.cAllowed functions
None. Write every helper yourself.

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.