Software Engineering

Mergesort Investigation 16 - sorting reverse sorted lists

Mergesort Investigation 16 - sorting reverse sorted lists

There’s one more item I discovered during my mergesort investigation that bothers me. I wrote code that finishes with a low-to-high data value list. Starting with a “reverse sorted” (high-to-low data values) list with Wikipedia’s bottom up algorithm does not show the abrupt performance drops that a randomly-chosen data values initial list does, but has bumps in comparison count at lists of 2N+1 lengths.

Why is this?

Go Syntax and Human Failings

Go Syntax and Human Failings

I wrote a Go program this morning. I thought of a super clever way to find the median of a sorted slice of float64 types. This clever way to do medians worked in the little program I wrote first, because I strictly follow Gall’s Law.