Solved

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

Posted on 2002-07-01
18
314 Views
Last Modified: 2010-03-31
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....
0
Comment
Question by:makineni_rk
  • 7
  • 6
  • 3
  • +1
18 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 25 total points
ID: 7121719
0
 

Author Comment

by:makineni_rk
ID: 7124257
Hi CEHJ,
I think B-Tree refers to Balanced Tree instead of Binary tree.

0
 
LVL 3

Assisted Solution

by:yasser_helmy
yasser_helmy earned 25 total points
ID: 7126471
hi,
try this link which says much about the btree structure

http://www.public.asu.edu/~peterjn/btree/

i hope this clears things up
0
 
LVL 35

Expert Comment

by:girionis
ID: 8893623
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
0
 
LVL 3

Expert Comment

by:yasser_helmy
ID: 8908142
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.. :)
0
 
LVL 35

Expert Comment

by:girionis
ID: 8908285
 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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8908295
Balancing is just a question of splitting up the tree AFAIK. Essentially the structures are the same.
0
 
LVL 3

Expert Comment

by:yasser_helmy
ID: 8908975
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..
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 35

Expert Comment

by:girionis
ID: 8909024
> 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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8909155
0
 
LVL 35

Expert Comment

by:girionis
ID: 8909295
 Nice work CEHJ :-) I completely forgot for the wayback archive.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8909304
:-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8909410
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 http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20676050.html#8907572 correct?
0
 
LVL 35

Expert Comment

by:girionis
ID: 8909633
> Is the observation i made at 07/12/2003 02:56AM PDT in http://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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8909638
Thanks. I was fairly sure some of the Sun compilers didn't as well...?
0
 
LVL 35

Expert Comment

by:girionis
ID: 8909721
 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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8910483
Hmm yes. So my notion of javac *.java might not be quite as unnecessary as some would think perhaps?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now