Skip to main content

Resonating Quote of the Day

Debugging 

/DE-BUHG-ING/ -verb

1. Being the detective in a crime movie
where you are also the murderer.

- unknown

Comments

Popular Posts

Permutation Algorithms: Finding the Highest Discount Between Coupons

When trying to determine which coupons, in which order, can offer the highest amount of discount across a basket of products, a permutation algorithm is required.  A permutation algorithm calculates and returns all possible arrangements of a given set of items, where the order of those items are unique.  In my research, I selected 4 permutation algorithms - Lexicographical, Heap's, Steinhaus-Johnson-Trotter-Even, and Recursive. They deliver perfectly unique permutations for my given set of coupons, but each does this in their own way. I picked these 4 to test for robustness and performance. All performed relatively quick, but do keep in mind - the use of a permutation algorithm is not for the faint of heart. It's big-O notation is usually O(2^n) or in this case O(n!), which means for just 4 items, 4 x 3 x 2 x 1 = 24 permutations; 5 items = 5 x 4 x 3 x 2 x 1 = 120 permutations. Therefore, it's a good idea to keep the number of items in your list as low as feasibly possible. ...

On Working On A Passion through Sourdough - It's All In The Details

"Working hard at something you don't believe in is called stress. Working hard at something you do believe in is called passion" - Simon Sinek Java programming is one of my passions, and has been for the last 15+ years. I have a few other passions - like gardening, baking, crocheting, and knitting - but Java has been a solid feature in my life, one way or another. In April of this year, as a pandemic started to rear its ugly head, I was offered an opportunity to grow another passion - a sourdough starter. My past credentials for bread-making have been dabbling in yeast breads, with the active dry variety, and quick breads; I have never worked with wild yeast. I realized an ember of passion was lit in me at the very beginning when I spent hours researching about sourdough starters the day before I was going to pick it up - what is it? how do I keep it alive? how do I make bread out of it? Will it attack me at night? By the time I had the starter in my hands, I had a recipe...