ZC-App AVL 0.6
Posted: Mon Apr 23, 2007 6:04 am
Hey people, I've finally managed to implement the AVL Data structure in a way that I am happy with.
It took me a long time, but I've finally done it. So, in the spirit of goodwill and all that jazz, I'm placing my implementation up here for people to learn from, modify, whatever.
If you do modify the source, please send me a copy of the updates. You can append your name to the source headers. If changes are made, please create a changelog. That would be much appreciated.
It is ZC-App AVL.
The code is broken up into multiple files, so that it can be dealt with much easier. The source follows the
Node Convention.
http://zenobit.asmhackers.net/nr_doc_code_standard.html
So far... this is what I have tested.
- Sequential insertion (0 up to 0xFFFF)
- Sequential insertion (0x10000 to 0x1)
- Random Insertion (of 0x10000 random keys)
- Deletion
- Tree destruction via repeated deletion of Root node.
- Tree destruction via repeated deletion of tree's minimum value.
- Tree destruction via repeated deletion of tree's maximum value.
- Tree destruction via repeated deletion of random nodes.
- Sequential deletion (0x0 to 0xFFFF)
- Sequential deletion (0x10000 to 0x1)
And... some code statistics:
- Compiled successfully under DevC++ 4.9 and GCC 3.4.3 - 3.4.6
- C99 Standard.
- Raw code < 300 lines.
- Iterative implementation, using parent links.
- No stacks in use for tracing balance-update paths.
If anyone finds this at all useful, it means a couple months of my life HASNT been wasted. So, that would be neat.
Anywho, Enjoy!
~zeii.[/url]
It took me a long time, but I've finally done it. So, in the spirit of goodwill and all that jazz, I'm placing my implementation up here for people to learn from, modify, whatever.
If you do modify the source, please send me a copy of the updates. You can append your name to the source headers. If changes are made, please create a changelog. That would be much appreciated.
It is ZC-App AVL.
The code is broken up into multiple files, so that it can be dealt with much easier. The source follows the
Node Convention.
http://zenobit.asmhackers.net/nr_doc_code_standard.html
So far... this is what I have tested.
- Sequential insertion (0 up to 0xFFFF)
- Sequential insertion (0x10000 to 0x1)
- Random Insertion (of 0x10000 random keys)
- Deletion
- Tree destruction via repeated deletion of Root node.
- Tree destruction via repeated deletion of tree's minimum value.
- Tree destruction via repeated deletion of tree's maximum value.
- Tree destruction via repeated deletion of random nodes.
- Sequential deletion (0x0 to 0xFFFF)
- Sequential deletion (0x10000 to 0x1)
And... some code statistics:
- Compiled successfully under DevC++ 4.9 and GCC 3.4.3 - 3.4.6
- C99 Standard.
- Raw code < 300 lines.
- Iterative implementation, using parent links.
- No stacks in use for tracing balance-update paths.
If anyone finds this at all useful, it means a couple months of my life HASNT been wasted. So, that would be neat.
Anywho, Enjoy!
~zeii.[/url]