Advertisement
Guest User

avl.h

a guest
Oct 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #ifndef _AVL_H_
  2. #define _AVL_H_
  3.  
  4. #include<stdio.h>
  5. #include<stdlib.h>
  6.  
  7.  
  8.  
  9. struct NodeAVL {
  10. int key;
  11. int echi;
  12. NodeAVL* left, * right;
  13. };
  14.  
  15. int max(int a, int b);
  16. int maxPathLength(NodeAVL* p);
  17. void computeBalanceFactor(NodeAVL* p);
  18. NodeAVL* leftRot(NodeAVL* root, NodeAVL* p);
  19. NodeAVL* rightRot(NodeAVL* root, NodeAVL* p);
  20. NodeAVL* doubleLeftRot(NodeAVL* root, NodeAVL* p);
  21. NodeAVL* doubleRightRot(NodeAVL* root, NodeAVL* p);
  22. NodeAVL* balance(NodeAVL* root, NodeAVL* p);
  23. NodeAVL* insertAVLNode(NodeAVL* root, NodeAVL* p, int x);
  24. NodeAVL* deleteAVLNode(NodeAVL* root, NodeAVL* p, int x);
  25. void displayAVLTree(NodeAVL* p, int level);
  26.  
  27. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement