We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Done it with the AVL Tree. Every node of the tree tracks not only height but also size which allows to calculate the index of the node and therefore the median.
Median Updates
You are viewing a single comment's thread. Return to all comments →
Done it with the AVL Tree. Every node of the tree tracks not only height but also size which allows to calculate the index of the node and therefore the median.
` class AVL: def init(self): self.root = None
The rest of the AVL tree implementation you may find on geeksforgeeks.