Binary search tree and Dictionary

Discussion in 'C++' started by bear220720@gmail.com, May 20, 2005.

  1. Guest

    I have a big problem about how to make this C++ program.
    I was asked to use binary search tree to built a dictionary.
    This program must have some function,
    1. Read a article file and include every word of it into the
    dictionary.
    2. When enter a word, it can make a search and report the word where
    the search eventually stops.
    If anyone has this kind of program, please send to me.
    Thank you!
    , May 20, 2005
    #1
    1. Advertising

  2. wrote:
    >
    > I have a big problem about how to make this C++ program.
    > I was asked to use binary search tree to built a dictionary.
    > This program must have some function,
    > 1. Read a article file and include every word of it into the
    > dictionary.
    > 2. When enter a word, it can make a search and report the word where
    > the search eventually stops.
    > If anyone has this kind of program, please send to me.
    > Thank you!


    Show your attempt for this homework question and tell us what your
    specific problem is. Then somebody will try to help you with
    that specific problem.
    But nobody is going to write this program for you from scratch.

    --
    Karl Heinz Buchegger
    Karl Heinz Buchegger, May 20, 2005
    #2
    1. Advertising

  3. Rolf Magnus Guest

    Karl Heinz Buchegger wrote:

    > wrote:
    >>
    >> I have a big problem about how to make this C++ program.
    >> I was asked to use binary search tree to built a dictionary.
    >> This program must have some function,
    >> 1. Read a article file and include every word of it into the
    >> dictionary.
    >> 2. When enter a word, it can make a search and report the word where
    >> the search eventually stops.
    >> If anyone has this kind of program, please send to me.
    >> Thank you!

    >
    > Show your attempt for this homework question and tell us what your
    > specific problem is. Then somebody will try to help you with
    > that specific problem.
    > But nobody is going to write this program for you from scratch.


    I will - for 250 Euros.
    Rolf Magnus, May 20, 2005
    #3
  4. Chris Theis Guest

    "Rolf Magnus" <> wrote in message
    news:d6kj42$fcq$05$-online.com...
    > Karl Heinz Buchegger wrote:
    >
    >> wrote:
    >>>
    >>> I have a big problem about how to make this C++ program.
    >>> I was asked to use binary search tree to built a dictionary.
    >>> This program must have some function,
    >>> 1. Read a article file and include every word of it into the
    >>> dictionary.
    >>> 2. When enter a word, it can make a search and report the word where
    >>> the search eventually stops.
    >>> If anyone has this kind of program, please send to me.
    >>> Thank you!

    >>
    >> Show your attempt for this homework question and tell us what your
    >> specific problem is. Then somebody will try to help you with
    >> that specific problem.
    >> But nobody is going to write this program for you from scratch.

    >
    > I will - for 250 Euros.


    Oh damn, if I had known that a long time ago ;-)

    Chris
    Chris Theis, May 20, 2005
    #4
  5. wrote:
    > I have a big problem about how to make this C++ program.
    > I was asked to use binary search tree to built a dictionary.
    > This program must have some function,
    > 1. Read a article file and include every word of it into the
    > dictionary.
    > 2. When enter a word, it can make a search and report the word where
    > the search eventually stops.
    > If anyone has this kind of program, please send to me.
    > Thank you!
    >

    1. Read a line from the file.
    2. Extact a word from that line.
    3. Add word to the container (list, vector, map, etc.)
    4. Repeat at step 2.
    5. Display contents of container.
    6. After the above works, expand program to read until
    the end of the file is reached.

    I would use the std::set container.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.comeaucomputing.com/learn/faq/
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
    http://www.sgi.com/tech/stl -- Standard Template Library
    Thomas Matthews, May 20, 2005
    #5
  6. red floyd Guest

    Thomas Matthews wrote:
    > wrote:
    >
    >>I have a big problem about how to make this C++ program.
    >>I was asked to use binary search tree to built a dictionary.
    >>This program must have some function,
    >> 1. Read a article file and include every word of it into the
    >>dictionary.
    >> 2. When enter a word, it can make a search and report the word where
    >>the search eventually stops.
    >>If anyone has this kind of program, please send to me.
    >>Thank you!
    >>

    >
    > 1. Read a line from the file.
    > 2. Extact a word from that line.
    > 3. Add word to the container (list, vector, map, etc.)
    > 4. Repeat at step 2.
    > 5. Display contents of container.
    > 6. After the above works, expand program to read until
    > the end of the file is reached.
    >
    > I would use the std::set container.
    >


    Of course, that will get him an F on his homework assignment, since he's
    probably supposed to roll his own BST. :)
    red floyd, May 20, 2005
    #6
  7. Simon Guest

    Hello,

    You can check out www.eassignment.net for help with your assignments.
    They are really helpful.

    Simon Tanner
    Simon, May 20, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gaz
    Replies:
    2
    Views:
    1,537
  2. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,097
  3. sharan
    Replies:
    4
    Views:
    676
    CBFalconer
    Oct 30, 2007
  4. sharan
    Replies:
    2
    Views:
    822
    SM Ryan
    Oct 31, 2007
  5. Bogdan

    Binary tree search vs Binary search

    Bogdan, Oct 18, 2010, in forum: C Programming
    Replies:
    22
    Views:
    3,037
    Michael Angelo Ravera
    Oct 21, 2010
Loading...

Share This Page