This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes B+ Tree in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "B+ Tree in Java" Watch "B+ Tree in Java" New topic
Author

B+ Tree in Java

Ganesh Pat
Ranch Hand

Joined: Feb 04, 2012
Posts: 79

hi friends, I want to fetch data of items from database and display it by price in ascending form in form of B+ Tree so please tell me should I use array or arraylist or vector for that ? I did binary tree in data structure but dunno how to do in java please need help....
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
I think you need to learn lots more about the collections framework. The first thing which sprang to mind was a sorted set. Remember that sets do not support duplicate values, so you cannot add two values which return 0 from the compareTo method or compare method of their Comparator.
Ganesh Pat
Ranch Hand

Joined: Feb 04, 2012
Posts: 79

@ Cambell no i also want duplicate values to be added in tree. The main problem is that the root node can have more than one node attached to it. Generally in binary tree or in any tree we have max 2 nodes from root node i.e left and right node and further nodes get added next to left or right node of root node but this is not the case here. Here root node which can have more than 2 nodes . I have attached a picture of that tree example if possible please have look at it.



[Thumbnail for b+.JPG]

 
 
subject: B+ Tree in Java
 
Similar Threads
tree view in jsp
Making binary tree: memory problem
Store Data in Tree Node
Saving tree structure
How to populate a form from a tree node