module BinomialHeap where
import BinomialHeapDef
— Precondition: the two trees have same rank
link :: Ord a => BinomialTree a -> BinomialTree a -> BinomialTree a
link = error “TODO”
— Binomial heap is [BinomialTree a] satisfying extra conditions.
— Precondition for insertTree t (t2:ts): t’s rank <= t2's rank
insertTree :: Ord a => BinomialTree a -> [BinomialTree a] -> [BinomialTree a]
insertTree = error “TODO”
insert :: Ord a => a -> [BinomialTree a] -> [BinomialTree a]
insert p heap = insertTree (Node 0 p []) heap
findMin :: Ord a => [BinomialTree a] -> Maybe a
findMin = error “TODO”
merge :: Ord a => [BinomialTree a] -> [BinomialTree a] -> [BinomialTree a]
merge = error “TODO”