
We had to incrementally optimize an algorithm for finding the median k-mer of a DNA sequence. Pseudo-code was given for a naive implementation so I first implemented that. Then, I added the branch-and-bound mechanism which significantly sped things up. Then, I implemented the trie to store k-mers which allowed me to optimize the algorithm to search promising k-mers first which sped things up slightly more. I was worried before submitting because my computer at home was slow and didn't pass tests as quickly as others but when I did it in the lab, it was 3x faster (in a class on algorithms where we talk about big-O, it annoyed me that they gave an absolute time for what we should shoot for). Ended up with 19/20 so I did it mostly right.