I have to add to an exisitng Java program the code for the DSW algorithm to balance a binary tree. I am relatively new to programming so I dont know where to start. Does anyone know where I can find an example of the code?

Thanks
Joey :-|

Recommended Answers

>Does anyone know where I can find an example of the code?
The following is a good description with C code. Fortunately, the differences are only in details. You can easily figure out how to translate the algorithm to Java.

Jump to Post

All 3 Replies

>Does anyone know where I can find an example of the code?
The following is a good description with C code. Fortunately, the differences are only in details. You can easily figure out how to translate the algorithm to Java.

http://www.stanford.edu/~blp/avl/libavl.html/Balancing-a-BST.html

Alternatively, you could get a membership with the ACM so that you have access to the digital library. Then you can read all of the wonderful papers concerning this method of globally balancing a binary search tree.

I have to add to an exisitng Java program the code for the DSW algorithm to balance a binary tree. I am relatively new to programming so I dont know where to start. Does anyone know where I can find an example of the code?

Thanks
Joey :-|

Thank you for the help. I was able to complete the progam I was working on.

Joey :mrgreen:

>Does anyone know where I can find an example of the code?
The following is a good description with C code. Fortunately, the differences are only in details. You can easily figure out how to translate the algorithm to Java.

http://www.stanford.edu/~blp/avl/libavl.html/Balancing-a-BST.html

Alternatively, you could get a membership with the ACM so that you have access to the digital library. Then you can read all of the wonderful papers concerning this method of globally balancing a binary search tree.

Thanks for all the help. It made life easier.
Joey

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.