This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A super-simple way to implement unit tests for a python program. | |
# example: tell me, true or false, if a number is odd. | |
# procedure: | |
# -- come up with test cases. | |
# -- write and rewrite code until all of your test cases pass. | |
# -- if you have time, refactor the end result to make it more readable. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class MergeSort { | |
private static void mergeSort(Integer[] inputArray) { | |
// CONTEXT | |
// This took about twelve hours of tweaking and line-by-line debugging. It's arguably spaghetti code. | |
// That is to say, I don't fully understand why it works! | |
// The first bit, splitting the list into intervals, is not so complicated. |