CST370 - Learning Journal 6
Author
Date Published

AVL Tree, Two/Three tree, Heaps
I just finished watching the videos on these topics and honestly I'm kind of at a loss for what to put here but, we forge onwards anyways.
The AVL tree seems to be just an optimized binary search tree. I binary search tree is nice but, without re-balancing some searches could result in a linear search time of O(n) when we would prefer O(log n) when using divide and conquer techniques such as binary search trees. To achieve this we just use a simple algorithm to re-structure unbalanced binary search trees into balanced AVL trees.
Makes sense. Although, in a practical sense re-sorting a whole tree from the top is O(n) at the very least. As with all of these algorithms, I am now much more curious regarding real world use cases where they are used.
Hashes being used for indexes to make search queries O(1) makes sense for databases but, I wonder when the other search algorithms are used.
I work on a platform that stores millions of comments in a database. We use elastisearch to make searching that database more efficient. Does elastisearch use these algorithms? Which one? I don't know but, I probably should lol.
Comments
Join the conversation! Login to reply to comments