• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

B+ Tree in Java

 
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 79
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ 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.
b-.JPG
[Thumbnail for b-.JPG]
This is algorithm want to develop in java
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic