Lecture#5 - Advanced Data Structure
Lecture#5 - Advanced Data Structure
STRUCTURE
CSE-237 : ALGORITHM DESIGN AND
A N A LY S I S
BINOMIAL HEAP
• Binary Heaps
• efficient findMin, deleteMin
• many applications
• Binomial Heaps
• Efficient merge of two heaps
• Merging two heap based data structures
• Binomial Heap is build using a structure called Binomial Trees
• Trees offer many many advantages – especially for quick inserting and
reasonably quick deleting.
• Binary tree searches provide outstanding performance in almost all instances
• Red-black trees are a variation of binary search trees to ensure that the tree is
balanced.
• Height is O(lg n), where n is the number of nodes.
• Red Black Trees is an approach to restructure unbalanced BST.
• All nodes will either be ‘red’ or ‘black’ with constraints!
• Always maintain balanced trees after the insert and/or delete opeartions
• Op Count:
- Each of M1, …, M7 rrequires 1 mult and 1 or 2 add/sub
- Total = 7 mul and 18 add/sub,
- Compared with brute force which requires 8 mults and 4 add/sub
• n/2 n/2 submatrices are computed recursively by the same method