Results 1 to 8 of 8
  1. #1
    theonly is offline Member
    Join Date
    Apr 2008
    Posts
    23
    Rep Power
    0

    Default [SOLVED] BST Frequency Counter

    I really need help on this one.

    Let me break this down I have two BST, one to hold all the letter of the alphabet and the other BST, which hold all the words that contains that letter.

    My problem is how do I call the 2nd BST within the 1st BST. I want my code to search the first BST for the letter the word began with, and then within that insert method call the second BST insert method.

    I hope that make sense.

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    10

    Default

    what is BST ?
    dont worry newbie, we got you covered.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  4. #4
    theonly is offline Member
    Join Date
    Apr 2008
    Posts
    23
    Rep Power
    0

    Default

    Yeah, a BST is a Binary Search Tree, and I'd figured it out. Thanks

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  6. #6
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    10

    Default

    could you please post your solution so that if others have the same problem they can refer back to this thread instead of creating a new one. That is how the forums are suppose to work.
    My IP address is 127.0.0.1

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  8. #8
    theonly is offline Member
    Join Date
    Apr 2008
    Posts
    23
    Rep Power
    0

    Default

    Ok, the quick and dirty explanation is to make your primary BST have a BST container ie:

    Java Code:
    private class Node{
    Node left, right;
    String data;
    BST secondaryBST = new BST();
    }
    and then whenever you want to have access to the secondary BST method just use a code like "node.secondaryBST.method()"
    I hope that make sense, if anyone need more explanation just let me know.

Similar Threads

  1. Help with static variable counter
    By silvia in forum New To Java
    Replies: 1
    Last Post: 07-19-2007, 07:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •