BST

Discussion in 'C++' started by Rupert harrison, Sep 15, 2003.

  1. How would I approach the implementation of a BST that gives a statistical
    breakdown of a text file and issues warnings on style eg. words too long or
    big.

    This is a hat. This is a dog.

    # of words used: 5 // word - sequnce of letters
    ending with a . , etc
    # of unique words: 4 // unique - words spelled the
    same
    avg sentence length:
    avg word length:
    Rupert harrison, Sep 15, 2003
    #1
    1. Advertising

  2. "Rupert harrison" <Wu > wrote...
    > How would I approach the implementation of a BST that gives a statistical
    > breakdown of a text file and issues warnings on style eg. words too long

    or
    > big.


    Start with the description of your input and output. Then describe
    what connects them (algorithm, I suppose). To fulfil the connection
    you need some data structures. You may need other data structures
    for input and output. Then you have a need to control the flow, you
    may need more data structures for that... I don't see a C++ language
    problem as of yet.

    >
    > This is a hat. This is a dog.
    >
    > # of words used: 5 // word - sequnce of letters
    > ending with a . , etc
    > # of unique words: 4 // unique - words spelled the
    > same


    That's strange. I counted 8 words of which 5 unique...

    > avg sentence length:
    > avg word length:
    Victor Bazarov, Sep 15, 2003
    #2
    1. Advertising

  3. Rupert harrison wrote:
    >
    > How would I approach the implementation of a BST that gives a statistical


    I don't know how you would approach it.

    I would start with:
    forget about statistical information and the BST at the moment and start
    with identifying words in the input stream. I would use some code which
    will be deleted later to convince myself that the reading part works
    the way I want it to be.

    Once that works I would start the implementation of a BST (without statistical
    information, just the BST). I would continue with feeding the words from
    step 1 into the BST and use that to debug the BST code. Again: Some later
    to deleted debug-code, such as an output function for the whole BST will come
    in handy.

    Once that BST is working I would add to the nodes whatever is needed to enable the
    statistical evaluation.


    Home-work assignment done.

    But that's just me. Your way of working may differ.

    --
    Karl Heinz Buchegger
    Karl Heinz Buchegger, Sep 15, 2003
    #3
    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. Andrew Edwards

    BST & recursion

    Andrew Edwards, Jul 30, 2003, in forum: C++
    Replies:
    12
    Views:
    760
    Karl Heinz Buchegger
    Aug 4, 2003
  2. Ridimz

    BST: remove less than

    Ridimz, Oct 4, 2003, in forum: C++
    Replies:
    8
    Views:
    520
    Josh Sebastian
    Oct 7, 2003
  3. Ice
    Replies:
    4
    Views:
    4,994
  4. puzzlecracker

    LL TO BST

    puzzlecracker, Jan 19, 2005, in forum: C++
    Replies:
    2
    Views:
    384
    Joseph Turian
    Jan 19, 2005
  5. AshifToday

    BST Source-Code

    AshifToday, May 22, 2005, in forum: C++
    Replies:
    0
    Views:
    617
    AshifToday
    May 22, 2005
Loading...

Share This Page