Hi there. Could I get some assistance on my Binary Trees project?
Your program should begin by prompting the user for a filename. Then, open that
file and use it as necessary to do the following: Use a binary search tree that stores at each node
both a string and a count of how many of that node it has found. Then, go through the file given
(text file) and starting with the first letter, put it onto the tree with a count of 1. Then get the next
character in the file, push it onto the tree, and so forth. If you ever try to add a node that has
already been added (for example, pushing an ‘a’ onto the tree that already has an ‘a’, increment
the count at that node.
Once that is done, go through the file again and get all consecutive 2-letter occurrences
and push them onto the tree. Again, if there is a match, increment the count.
Repeat this entire process until you reach a ‘k’ long sequence.
There are two main parts to this problem. One is the binary tree. The other is the code that reads and re-reads the file, inserting into the binary tree. Start with one of these and try to get it working. Then do the other one.