Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

B+ Tree in Java

 
Ranch Hand
Posts: 79
Java
  • Mark post as helpful
  • send pies
  • 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: 68148
258
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!