Advertisement
filashkov

AVL tree

Nov 25th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. // AVL tree.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
  2. //
  3.  
  4. #include <iostream>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <stdbool.h>
  8.  
  9. using namespace std;
  10.  
  11. struct Node
  12. {
  13.     int key;
  14.     int value;
  15.     Node* left;
  16.     Node* right;
  17.     int height;
  18. };
  19.  
  20. struct Node* newNode(int key, int value)
  21. {
  22.     struct Node* node = (struct Node*)malloc(sizeof(struct Node));
  23.     node->key = key;
  24.     node->value = value;
  25.     node->left = NULL;
  26.     node->right = NULL;
  27.     node->height = 1;
  28.     return node;
  29. }
  30.  
  31. void insert(struct Node* root, int key, int value)
  32. {
  33.  
  34. }
  35.  
  36. void find(struct Node* root, int key)
  37. {
  38.  
  39. }
  40.  
  41. void pop(struct Node* root, int key)
  42. {
  43.  
  44. }
  45.  
  46. int main()
  47. {
  48.     int n;
  49.     cin >> n;
  50.     for (int i = 0; i < n; i++)
  51.     {
  52.         char operation;
  53.         cin >> operation;
  54.         if (operation == 'F')
  55.         {
  56.             return 0;
  57.         }
  58.         int key;
  59.         cin >> key;
  60.         if (operation == 'D')
  61.         {
  62.             delete()
  63.         }
  64.     }
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement