anagram

get list of anagrams from a dictionary

落花浮王杯 提交于 2019-11-26 14:34:57
问题 Basically, Anagrams are like permutation of string.E.g stack , sackt , stakc all are anagrams of stack (thought above words aren't meaningful). Anyways you could have understood what I basically meant. Now, I want a list of anagrams given million words or simply say from a dictionary. My basic question is Find total number of unique anagrams in a dictionary? Sorting and comparing won't work as it's time complexity is pretty bad. I thought of using hash table, string as key. But the problem is

How to check if two words are anagrams

僤鯓⒐⒋嵵緔 提交于 2019-11-26 07:29:44
I have a program that shows you whether two words are anagrams of one another. There are a few examples that will not work properly and I would appreciate any help, although if it were not advanced that would be great, as I am a 1st year programmer. "schoolmaster" and "theclassroom" are anagrams of one another, however when I change "theclassroom" to "theclafsroom" it still says they are anagrams, what am I doing wrong? import java.util.ArrayList; public class AnagramCheck { public static void main(String args[]) { String phrase1 = "tbeclassroom"; phrase1 = (phrase1.toLowerCase()).trim(); char

How to check if two words are anagrams

ⅰ亾dé卋堺 提交于 2019-11-26 03:25:12
问题 I have a program that shows you whether two words are anagrams of one another. There are a few examples that will not work properly and I would appreciate any help, although if it were not advanced that would be great, as I am a 1st year programmer. \"schoolmaster\" and \"theclassroom\" are anagrams of one another, however when I change \"theclassroom\" to \"theclafsroom\" it still says they are anagrams, what am I doing wrong? import java.util.ArrayList; public class AnagramCheck { public