It's a tough call. Probably what's "best" will just boil down to personal preference and/or the specifics of the circumstances at hand.
On the one hand, each directory isn't technically "related" to any other. While they do implement the same algorithm, none depends on any of the others (so from a pure source code point of view, they are unrelated). Usually, unrelated things are best left in separate repos (for reasons identified in Craig McQueen's answer).
However, because they do implement the same algorithm, you may find that if you need to change the algorithm, you'll need to make very similar changes to all of the directories. In such a case, it might make sense to make all of the changes as a single commit. Let's say you decide the algorithm needs to support "virtual dinglehoppers". You'd add that support to each directory and make a single commit whose message is "Add support for virtual dinglehoppers". This is nice because if you later decide that adding virtual dinglehopper support was bad, you can now revert just a single commit. The alternative is to make three separate commits to three separate repositories and then revert three separate commits from three separate repositories.
Again, it's a tough call. I don't think there's a clear-cut, hard-and-fast rule to go by.