Thread: Please help me with this problem? :(

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    225

    Please help me with this problem? :(

    hello,

    the problem question is :-
    1) there is a file given in which words are stored

    2)we have to make T9 dictionary that's available in our cellphones


    User can input for example 223 so the output should be every meaningful word that comes from this combination like bad,ace etc..


    (223 means similar to our cellphones where 2=abc 3=def 4=ghi..)

    Just give me few logics then i will try to make it but i am not getting a general idea i want somebody to give me general idea only!

    i know we need permutations in this program but how??Please explain me in better way

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So, what have you done so far?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    225
    I haven't done anything i don't know from where to start and where to end in this program Please give me general idea so that i can start coding on it!

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The key to this problem is the dictionary structure. It has to be a special form of a trie. It works basically like this: the dictionary is a large tree. At every level, it splits into 9 subtrees (digits 1-9). Every node contains all the words that are possibly formed by the digit chain used to reach it.
    You should be able to work from here.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, before you start writing code you will need to think about HOW you should implement the code - this is called a "design". Depending on the project and the experience of the people involved, you may find that writing a 30 page document, or just write down a few data structures and a few lines of text is the right thing to do, but whatever you do, you need to have a "plan" for your software design. Just like you wouldn't build a house without at least drawing a few lines on a piece of paper to figure out what it's going to look like. If you are building a rabbit hutch, you may be able to get away with "just doing it". Same with a "hello world" program.

    Obviously, the more experience you have, the more knowledge you have, and the less detailed the plan needs to be. But you need some sort of general plan - even a master builder will need to do some work before starting the actual building work, right?

    So, how would you store the data (data structures), how do you find the matching strings from the data (methods/algorithms) etc, etc.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM