# Implementing Binary Search Tree term Counter

Page 1 of 1

## 0 Replies - 1427 Views - Last Post: 05 November 2008 - 08:58 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=70596&amp;s=c9aa48e96be5c0088a5ed6ec805b96e4&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Learner_Net

Reputation: 0
• Posts: 1
• Joined: 05-November 08

# Implementing Binary Search Tree term Counter

Posted 05 November 2008 - 08:58 AM

Hi Experts!

I am currently working on a Binary search tree Class which I need for counting the number of times each term in a bunch of lines appear.

I have set up the structure, and I want it to be outlined as follows
```Public Interface Term_Count

' Starts the iteration through the terms.
Sub StartIteration()

' Returns true if there are more terms.
Function HasMore() As Boolean

' Returns the next TermCount pair.
Function GetNext() As TermCount

' Increments the count of the given term.
' If the term does not yet exist in the TermCounter,
' the count is set to 1 for the term.
Sub IncrementCount(ByVal term As String)

End Interface
```

Can you please guide me as to how I should implement this algorithm in a time efficient manner?

Is This A Good Question/Topic? 0

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }