Advertisement
Mikhail-Podbolotov

Untitled

May 29th, 2024
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #pragma once
  2. struct Element {
  3.     Element* RightSon = nullptr;
  4.     Element* LeftSon = nullptr;
  5.     int value;
  6.     Element(int x);
  7.     ~Element();
  8. };
  9.  
  10. class Tree {
  11. private:
  12.     Element* Head = nullptr;
  13. public:
  14.     Tree();
  15.     ~Tree();
  16.     void Add(int value);
  17.     int GetMaxElementCount();
  18.     int GetHeight(Element* node);
  19.     bool isBalanced(Element* node);
  20.     bool isBalanced();
  21.     bool FindDivEL(Element* node, int& result);
  22.     bool FindDivEL(int& result);
  23. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement