A word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.
Questions tagged [anagram]
470 questions
-3
votes
3 answers
This is an anagram program where I am checking if two same length strings are anagram to each other
The if statement doesn't terminate the while loop for some reason, which results in unwanted outputs (more than one output). I hope someone can help. Thanks.
my code
![](../../users/profiles/11844359.webp)
tash29
- 1
-3
votes
1 answer
How can I simplify this program(anagram)?
This is algorithm that counts the number of character shifts. How can I simplify this?
#include
#include
#include
using namespace std;
#define SIZE 20
int w[1 << (SIZE + 1)];
![](../../users/profiles/10786450.webp)
bpaul
- 3
- 2
-3
votes
1 answer
Anagram program debugging
I'm trying to debug this program but can't seem to find the bug with this program. Every 2 letter word is considered an anagram and every word with more than 2 letters is considered not an anagram.
#include
#include
using…
![](../../users/profiles/6115274.webp)
H.C
- 9
- 1
- 8
-3
votes
2 answers
Finding anagrams contained in a given string
I'm trying to write a program which accepts a string and groups anagrams
of the string together in list of lists, sorted lexicographically.
For example, the following string:
eat tea tan ate nat bat
Should produce the following output(order of the…
![](../../users/profiles/3917987.webp)
Landon
- 11
- 6
-3
votes
1 answer
Inefficient Anagram Solver
The following program basically generates an Anagram and proceeds to solve it:
#include
#include
#include
#include
#include
#include
using namespace std;
int random(){
int val = rand() %…
![](../../users/profiles/4892346.webp)
Bilal Musani
- 45
- 1
- 7
-4
votes
2 answers
Function Anagram
An anagram is a word formed from another by rearranging its letters, using all the original letters exactly once; for example, orchestra can be rearranged into carthorse.
I want to write a function to return all anagrams of a given word (including…
![](../../users/profiles/3960155.webp)
Ashley Niekerk
- 3
- 1
-4
votes
3 answers
How to find the anagrams in a given list
I am trying to print out the anagrams in a given list. I am unable to arrive at the right answer. I'd like to know where I am going wrong, and how can I fix it.
words = ['bat', 'rats', 'god', 'dog', 'cat', 'arts', 'star']
sort_words = []
anagrams =…
![](../../users/profiles/5744972.webp)
KeerthiP
- 11
- 1
- 5
-4
votes
3 answers
Can my Anagram Program Run? If yes, why is it not compiling?
my program does not compile. It keeps on saying:
[ERROR] invalid conversion from 'char' to 'char*'
It should be a program that identifies if two strings are an anagram of each other.
I used a sorting method but i don't know if it will work.
Hope…
-4
votes
2 answers
I'm trying to create a program that creates anagrams from a string of words
I'm new to python - so from a list of predetermined words jumble the letters and return the jumbled letters.
![](../../users/profiles/5910474.webp)
Zapp
- 3
- 2
-4
votes
2 answers
Anagram Program to Compare two Strings
I am creating an anagram program which compares two strings and am unsure how to go about creating a boolean that returns true if a character appears in both words.
My code is as follows:
StringBuffer strbuff1 = new StringBuffer("");
private…
![](../../users/profiles/5530880.webp)
CsStudent
- 1
- 2
-4
votes
3 answers
How to check if two words are anagrams in c
I am trying to create a programme that is able to determine whether two inputted words are anagrams of each other.
The way in which I have been told to go by my tutor is to count how many of the first letter of one word there is, then compare to the…
![](../../users/profiles/4629883.webp)
Danthescotman
- 11
- 3
-4
votes
1 answer
which of these two implementation is faster and why , to check the strings anagram
First one using Arrays.sort
public static void main(String[] args) {
String s="schoolmaster";
String s1="theclassroom";
char a[]=s.toCharArray();
Arrays.sort(a);
char a1[]=s1.toCharArray();
…
![](../../users/profiles/1115122.webp)
anshulkatta
- 1,952
- 18
- 29
-4
votes
4 answers
String editing in python to find anagrams
Given the string...
able\nacre\nbale\nbeyond\nbinary\nboat\nbrainy\ncare\ncat\ncater\ncrate\nlawn\nlist\nrace\nreact\nsheet\nsilt\nslit\ntrace\n
I am trying to figure out how to assign each word in the string to a variable, and then sort each word…
![](../../users/profiles/2172473.webp)
Aaron
- 49
- 2
- 7
-4
votes
2 answers
How do I make an ArrayList of ArrayLists from an ArrayList by using a function that makes ArrayLists in an ArrayList from Strings of an ArrayList
I have a java program that
reads a text file,
puts all it's words in an ArrayList
puts all the words into an ArrayList, lowercase with punctuation removed
I now want to make two more things.
A function that creates all the anagrams of the strings…
![](../../users/profiles/2159236.webp)
Ryan Tibbetts
- 392
- 1
- 6
- 20
-5
votes
1 answer
Comparing two strings for Anagram using hash
I'm new to perl. Can anyone give an example to a perl code for detecting anagram between to given strings using hash's. two strings - pool and polo.
![](../../users/profiles/7656228.webp)
rising_thunder
- 11
- 1