Link to home
Start Free TrialLog in
Avatar of makineni_rk
makineni_rk

asked on

How to perform insertion and deletion on table data using BTree algorithm

I require to perform sorting of rows and also insertion  of new rows,Deletion of rows for a huge amount of data(around 10,000 records) using BTree search algorithm in JAVA. I need to sort based on date,time and category id(These are the primary fields present in my records).
So please help me out in solving this problem. As i heard Btree algorithm is best used for Insertions and deletions.

If any one of have the source code for B-tree search algorithm in JAVA please share with me.

It's  very urgent
Thanks in advance....
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of makineni_rk
makineni_rk

ASKER

Hi CEHJ,
I think B-Tree refers to Balanced Tree instead of Binary tree.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to CEHJ

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
Hi Girionis,
thanx for you help cleaning the questions..
but as you may note.. makineni_rk refused the answer given by CEHJ.. CEHJ gave a very useful link for binzry trees.. but the question was about b-trees which are a completely different data structure.. i wanted to add more comments to this question, but i thought the link i gave explains many aspects of b-trees.. and i waited for more questions from makineni.. i think i can help him.. but he must read and then all experts -not only me- can help..
i hope i made didnt upset anyone.. :)
 Hello yasser_helmy,

  First of all your link does not work (I am sure it was working when you first posted) so I cannot tell if it was of help or not.

  Second,

> CEHJ gave a very useful link for binzry trees.. but the question was about b-trees which are a completely different data structure..

  Is a balanced-tree not a binary tree? AFAIK a binary tree can either be a balanced-tree or an unbalanced tree. Of course I might be wrong so if you have any more information on that please let me know and I will reconsider my comment.
Balancing is just a question of splitting up the tree AFAIK. Essentially the structures are the same.
Hi all,
i am sorry about the link.. i assure you it was working one year ago..
i have some notes:
1- b-tree does not stand for balanced tree.. as i read in a great book of data structures, the history of the name is not known..
2- a binary tree is a structure in which every node points to a max of 2 other nodes called its right and left children..
3- a binary search tree insures that the left child of a node is less than the node and the right child is greater than the node..
4- binary trees dont have to be balanced.. some binary trees are balanced, like avl trees..
5- b-trees are balanced in the sense that all leaf nodes are in the same level.. the node are classified into internal and external nodes..
> i am sorry about the link.. i assure you it was working one year ago..

  I am pretty sure it was too :-) That's one bad thing when you go through past questions, several links are no longer valid so the comments cannot be evaluated properly.

  As for the rest, you are right, a binary tree can be balanced but a balanced tree is not always a binary tree.

  Honestly, if I could see the link you posted I would probably have recommended a split since I believe that both links could have provided a valid help. But I can't evaluate it now :-(... Maybe if you search and find it somewhere else and post it here a moderator will consider a split.
 Nice work CEHJ :-) I completely forgot for the wayback archive.
:-)
girionis - i wonder if you'd be kind enough to jog my memory (talking of 'way back')? Is the observation i made at 07/12/2003 02:56AM PDT in https://www.experts-exchange.com/questions/20676050/cannot-resolve-class.html#8907572 correct?
> Is the observation i made at 07/12/2003 02:56AM PDT in https://www.experts-exchange.com/ Programming/Programming_Languages/Java/Q_20676050.html#8907572 correct?

  Yes it is correct. A few older versions of java compilers didn't automatically compile dependent classes.

  One example was jikes. AFAIK original versions of jikes do not compile dependent classes automatically (you have to use the -depend switch or something like this)  but better take a look at the jikes home page, just to be completely sure.
Thanks. I was fairly sure some of the Sun compilers didn't as well...?
 Not 100% sure here but even javac won't compile all files automatically. If you have a Son.java that calls the "Father" class, a Father.java that calls the "GrandFather" class and a GrandFather.java files and there are no class files in existance then if you do: "javac Son.java" then all .java files (Son, Father and GrandFather) will be compiled.

  However if Son.java is changed and GrandFather.java is changed (and there is a Son.class and a  GrandFather.class) but Father.java is *not* changed then by doing: "javac Son.java" will not result in recompilation of GrandFather.java automatically.
Hmm yes. So my notion of javac *.java might not be quite as unnecessary as some would think perhaps?