refactor merge function in adaptive sort
optimize merge function in adaptive sort
set up a new test case for adaptive sort