Posts tagged with algorithms

Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

What is a binary tree and why would I ever want to reverse it

frederickvanbrabant.com

Senior CEO Frederick Vanbrabant helps you to answer this horrible interview question.

You have probably already heard the horror stories of code interviews where they ask you to reverse a binary tree on a whiteboard. (if not check this blog post that I profoundly disagree with). Well, a few days ago I was in that exact situation. And I had no idea what the interviewer was talking about. So what are these binary trees and why is it so critical that you know how to inverse them? Let’s find out.

Read more [frederickvanbrabant.com]

Lambda To The Rescue: Recursion

engagor.github.io

Toon Daeleman, developer at Engagor, explains how functional languages use recursion instead of loops.

Most programming languages have language structures to loop through lists and do interesting stuff with those lists. When you're used to programming using one of those languages, it can be pretty terrifying to have your basics taken away from you when you jump into a functional programming language like Scheme or Haskell. Let's see what the problem is that functional languages have with loops and how they solved it.

Read more [engagor.github.io]

Finding differences in images with PHP

Over at Sitepoint Christoper Pitt shares some research he has done in finding differences in images using PHP.

I recently stumbled across a fascinating question: how could I tell whether an image had changed significantly? As PHP developers, the most troublesome image problem we have to deal with is how to resize an upload with an acceptable loss of quality.

In the end I discovered what many before me have – that this problem becomes relatively simple given the application of some fundamental mathematical principles. Come along with me as we learn about them…

https://www.sitepoint.com/finding-differences-in-images-with-php

Read more