[New Algorithm] Anagram

Jon Bentley’s book Programming Pearls contains a problem about finding anagrams of words. The statement: Given a dictionary of english words, find all sets of anagrams. For instance, “pots”, “stop” and “tops” are all anagrams of one another because each can be formed by permuting the letters of the others. I thought a bit and…

Java Merge Sort

Here is a Java example of Merge Sort algorithm:

And here is the Bootom Up Merge Sort: