Finding "the harder way" easier

I was reminded of this by looking through my archives of old class programs. Once in an “analysis of discrete structures” (which doubles as an “intro to algorithmic analysis”) we had to write a 3-5 tree to catalog all the words in a text document (how often each word occurred). The teacher kept saying to write a 3-5 tree, because writing the general version, a B-tree, because writing a B-tree is REALLY HARD. He said we could try if we wanted and he’d accept it, but it would be so much harder than writing a 3-5 tree.

So I started to write a 3-5 tree, and found it REALLY HARD. There were a number of edge cases, and I generally just found it obnoxious. While working through the problems of the 3-5 tree I started trying to just reason out the edge cases in a more abstract fashion on paper. And I realized that, in my head, was the template for a generalized B-tree. So I wrote a B-tree implementation in about 2 hours, wrapped it in a 3-5 tree class (all that class did was make a 3-5 tree with two pre-determined arguments). Then torture tested it with various text documents and test cases according to the spec (and then fed it the Project Gutenberg .txt. version of War and Peace just for fun) and it worked fine. It was so much easier than the 3-5 tree, I have no idea what that instructor was talking about. (Also, it really helped on the test since I figured out a lot of general properties of B-trees in general on that assignment).
… I got 15 points off for “not writing a 3-5 tree”.

ETA: Obviously this thread exists to share your own tales as well, not just a personal brag thread.

Same shit happens to me all the time.