Briefly discuss how the color rules help with balancing the tree (write a bit about 2-4 trees). Compare the performance of this red black tree to a random binary search tree or treap. The four color rules of the red-black tree help the tree maintain a structure that is balanced. To understand more on red-black…
What difference is there between the A* algorithm and Dijkstra’s algorithm? (in terms of nodes explored) The difference between A* and Dijkstra’s algorithm in terms of nodes explored is that A* is less greedy and has a more educated guess h, the heuristic functions that helps us lessen the nodes explored. In Dijkstra’s, as it…
When would you use a binary search tree over a treap? I think I would use a binary search tree over a treap in terms of complexity in implementation. Binary search trees are simpler. However, practical-wise, I would use a binary search three if I have a set of numbers that are sorted randomly because…