From the Demo menu, access the Merge sort code, then select File > Auto Save and complete the dialog to ensure that your code is always saved.
Remember that you can use the Undo button (or Ctrl+z) to undo recent changes.
Note that the code contains two functions:
sort and merge, plus two tests - one to test each function -
with both tests covering multiple test cases (assert instructions).
The asserts in test merge are all showing pass
because the implementation of the merge function is complete and correct.
The asserts in test sort are all failing
with the message: actual: [x]. Looking at the code for the
sort it is not hard to see why: this is merely a 'skeletal' implementation:
sufficient code only to compile, not to run correctly. Your task is to implement sortproperly, until all the tests
pass. Your implementation should:
adopt the 'merge sort' algorithm
make use of the existing merge function
be recursive
result in all tests passing (without modifying those tests)