GCD and the magic of subtraction

The greatest common divisor is something I learned in school but it was one of those “so what?” subjects. But recently I revisited it and it is very interesting. Why is gcd cool? Every number, can be expressed as the product of prime numbers. This product for every number is unique; sort of like saying,Continue reading “GCD and the magic of subtraction”

Sitting with: Lomuto’s Partitioning Scheme

I snagged this pseudocode from Wikipedia and I am planning on going through it step by step to understand what is going on. I recommend having this snippet handy for reference. Here is my breakdown. The Idea The Lomuto partitioning scheme is used to partition an array into 2 parts, smaller and bigger than theContinue reading “Sitting with: Lomuto’s Partitioning Scheme”