Answer the question
In order to leave comments, you need to log in
How to implement combineTrees and extractMin in haskell?
Hello. I'm doing a Haskell lab and ran into problems. Can someone help
data BinomTree a = Node a Int [BinomTree a]
deriving (Eq, Ord, Show)
type BinomHeap a = [BinomTree a]
-- ������ 1 -----------------------------------------
combineTrees :: Ord a => BinomTree a -> BinomTree a -> BinomTree a
combineTrees = undefined
-- ������ 2 -----------------------------------------
extractMin :: Ord a => BinomHeap a -> a
extractMin = undefined
-- ������ 3 -----------------------------------------
mergeHeaps :: Ord a => BinomHeap a -> BinomHeap a -> BinomHeap a
mergeHeaps = undefined
-- ������ 4 -----------------------------------------
insert :: Ord a => a -> BinomHeap a -> BinomHeap a
insert = undefined
-- ������ 5 -----------------------------------------
deleteMin :: Ord a => BinomHeap a -> BinomHeap a
deleteMin = undefined
-- ������ 6 -----------------------------------------
binomSort :: Ord a => [a] -> [a]
binomSort = undefined
-- ������ 7 -----------------------------------------
toBinary :: BinomHeap a -> [Int]
toBinary = undefined
Answer the question
In order to leave comments, you need to log in
Everything is simple: you need undefined
to replace it with the implementation of the corresponding functions. Good luck!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question