Skip to content

Instantly share code, notes, and snippets.

@saadtaame
Last active October 11, 2016 14:35
Show Gist options
  • Save saadtaame/4d574c6a0a51f87003225c273bd52256 to your computer and use it in GitHub Desktop.
Save saadtaame/4d574c6a0a51f87003225c273bd52256 to your computer and use it in GitHub Desktop.
struct PairingHeap {
HeapNode *root;
PairingHeap():
root(NULL) {}
int Top(void) {
return ::Top(root);
}
void Push(int key) {
root = ::Push(root, key);
}
void Pop(void) {
root = ::Pop(root);
}
void Join(PairingHeap other) {
root = ::Merge(root, other.root);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment