Loading topic
merge of two sorted lists. The other covered splitting a list in half until a single element re6 min readmerge and merge_sort and traced them on examples. Examples can show that code works on the inputs you tried. They cannot show that it works on every input. This chapter gives an argument that covers all inputs. First we prove that merge is correct using a loop invariant.6 min readmerge_sort and merge functions from the earlier chapters. The goal here is to show why that code runs in O(n log n) time on every input, using th7 min readlambda functions. Here we look at one property of merge sort that comes from a single character in the merge loop: the `<=6 min readT(n) = 2T(n/2) + O(n) analysis, and why the merge uses <= to stay stable. You should also be able to read Python that sorts a list 7 min read