There were other questions regarding checking for anagrams. I want to construct all unique anagrams of a word. I'm not sure as to where it would be applicable but it's fun. I used an algorithm previously, thanks to sanyarem. As he himself points out, the algorithm doesn't generate unique results. SO I was wondering if there is a standard way to do it considering it's a mathematical question in the basic level. I checked out some journals too, but they had recursive functions or n-for loop methods which take a long time.
EDIT: Wow..no one? okay, let me tell you my approach, maybe improvements can be suggested. I'm assigning each character in the string a number. Yes, this kind of restricts the $n < 9$. Then I iterate from the minimum number that can be formed from the assigned numbers. And I iterate until the max. number that can be formed from the same set.
For each iteration, I check if the number at present is a permutation of the key (the original character to number conversion). If it is, then it is an anagram. This way repetitions are avoided too.
Problem: The efficiency is way too low.