Yesterday I updated the library by adding heap trees (Min & Max heap).
Though it was successful, but the approach was quite straight Forward.
It was just an implementation of the of HeapSort /Priority Queue using array.
This is logically very disappointing and inefficient for me.
What I actually want to do is:
Implement this using a true the Logic of Trees without using Arrays/Lists to store the elements.
Which instead uses TreeNode relationships between Parent and Children.
This would cut the cost to construct the tree every time a node gets deleted or inserted
Which definitely would help make this data-Structure an efficient one.
Besides I will implement the same algorithm I implemented yesterday in PriorityQueue inside Array module in upcoming future, so it won't make any difference if I also did the same in the Heap Tree.
Thanks to hariuserx for his valuable implementation of heap without arrays in Java. I made small modifications in his logic and implemented the code in python :).
Yesterday I updated the library by adding heap trees (Min & Max heap).
What I actually want to do is:
Besides I will implement the same algorithm I implemented yesterday in PriorityQueue inside Array module in upcoming future, so it won't make any difference if I also did the same in the Heap Tree.
Help Required !