Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > BST

Reply
 
 
Rupert harrison
Guest
Posts: n/a
 
      09-15-2003
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:





 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      09-15-2003
"Rupert harrison" <Wu http://www.velocityreviews.com/forums/(E-Mail Removed)> 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:



 
Reply With Quote
 
 
 
 
Karl Heinz Buchegger
Guest
Posts: n/a
 
      09-15-2003


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
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BST Source-Code AshifToday C++ 0 05-22-2005 03:10 AM
LL TO BST puzzlecracker C++ 2 01-19-2005 11:10 PM
Applications of stacks/queues/trees/heap/BST Ice C++ 4 12-19-2004 06:04 PM
BST: remove less than Ridimz C++ 8 10-07-2003 01:40 AM
BST & recursion Andrew Edwards C++ 12 08-04-2003 10:54 AM



Advertisments