Solved

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

Posted on 2002-07-01
18
322 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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
 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 50
micro services spring boot application error 3 183
servlet example issue 6 38
Java Restore security prompts not working 10 7
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

808 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