annaram of word from dictionary

P

pangamutle

We have a table which has all words and their meaning of
dictionary in it.you are given a word and now find all anagram of that
word and their meaning as well.annagram means like we have word top
then pot is one anngram.

can u suggest me a best optimal algorithms for this
 
O

osmium

We have a table which has all words and their meaning of
dictionary in it.you are given a word and now find all anagram of that
word and their meaning as well.annagram means like we have word top
then pot is one anngram.

can u suggest me a best optimal algorithms for this

Would you settle for _an_ algorithm instead of best optimal? Besides that,
"best optimal" sounds like there should be only one algorithm, not several.

I would think about putting the dictionary in a tree and using
next_permutation() in <algorithm> for the input data, such as "top".
 
V

Victor Bazarov

We have a table which has all words and their meaning of
dictionary in it.you are given a word and now find all anagram of that
word and their meaning as well.annagram means like we have word top
then pot is one anngram.

can u suggest me a best optimal algorithms for this

Read the FAQ 5.2 and the rest of section 5.
 
M

Miguel Gimenez

We have a table which has all words and their meaning of
dictionary in it.you are given a word and now find all anagram of that
word and their meaning as well.annagram means like we have word top
then pot is one anngram.

can u suggest me a best optimal algorithms for this

Also, look in your table for the correct spelling of anagram. You wrote
it four times, each with a different spelling.
 
G

Gavin Deane

We have a table which has all words and their meaning of
dictionary in it.you are given a word and now find all anagram of that
word and their meaning as well.annagram means like we have word top
then pot is one anngram.

can u suggest me a best optimal algorithms for this

C++ algorithms live in the <algorithm> header. Each anagram is a
different permutation of the letters in the original word and
<algorithm> provides std::next_permutation.

The FAQ explains how to get help with code you are trying to write.

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8

Gavin Deane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,508
Members
48,193
Latest member
DannyRober

Latest Threads

Top