Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CTreapNode* Insert(CTreapNode*& root, int key, int priority)
- //{
- //
- // if (root->Priority > priority) {
- // if (root->Key > key) {
- // if (root->Left != 0) {
- // Insert(root->Left, key, priority);
- // }
- // else {
- // root->Left = new CTreapNode(key, priority);
- // }
- // }
- // else {
- // if (root->Right != 0) {
- // Insert(root->Right, key, priority);
- // }
- // else {
- // root->Right = new CTreapNode(key, priority);
- // }
- // }
- // }
- // else {
- // CTreapNode* newNode = new CTreapNode(key, priority);
- // CTreapNode* splitLeft = 0;
- // CTreapNode* splitRight = 0;
- //
- // Split(root, key, splitLeft, splitRight);
- // root = newNode;
- // root->Left = splitLeft;
- // root->Right = splitRight;
- // return root;
- // }
- //
- // return root;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement