二项式堆
#ifndef BINOMIAL_HEAP #define BINOMIAL_HEAP #include <vector> #include <algorithm> #include <iostream> template<typename T> struct BinomialNode { T val; BinomialNode *leftChild; BinomialNode *nextSibling; BinomialNode(const T &data, BinomialNode *left, BinomialNode *next) : val{ data }, leftChild{ left }, nextSibling{ next }{} BinomialNode(T &&data, BinomialNode *left, BinomialNode *next) : val{ std::move(data) }, leftChild{ left }, nextSibling{ next }{} }; template<typename K, typename Cmp = std::less<K>> class BinomialHeap { using BinomialNode = BinomialNode<K>; public: BinomialHeap() :