Hari's Weblog

#algorithms

Solving AoC Day 3 Without Thinking

I'm doing Advent of Code again this year, and part 1 of today's problem reminded me immediately of some of the problems I'm doing in my Program Construction module at UCD. So, I'm going to be coming up with a formally verified algorithm to solve Part 1 using Edsger W. Dijkstra's Structured Programming style of Program Composition.

Insertion Sort is... Crappy Mergesort?

Something I realised while playing around with sorts in Haskell.

Using the Shunting Yard Algorithm to Write Truth Tables

If you've gone through the first year of a undergraduate Computer Science degree, you'll have written enough truth tables to last you a lifetime. Personally, I decided I'd had enough halfway through the semester and wrote a program to write my truth tables for me in Go. Unfortunately, we'd moved on from the topic before I finished working on this, but I still think it's a pretty interesting project.