-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtp03.h
30 lines (24 loc) · 772 Bytes
/
tp03.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#ifndef TP03
#define TP03
struct AvlNode{
int data;
struct AvlNode* leftChild;
struct AvlNode* rightChild;
int height;
}*root;
int getHeight(struct AvlNode *p);
struct AvlNode* insertAvl(struct AvlNode *p,int data);
struct AvlNode* LLRotate(struct AvlNode *p);
struct AvlNode* LRRotate(struct AvlNode *p);
struct AvlNode* RRRotate(struct AvlNode *p);
struct AvlNode* RLRotate(struct AvlNode *p);
struct AvlNode* deleteNode(struct AvlNode *p,int data);
struct AvlNode* findMax(struct AvlNode *p);
struct AvlNode* findMin(struct AvlNode *q);
void printPostOrder(struct AvlNode *head);
void printPreOrder(struct AvlNode *head);
void printInOrder(struct AvlNode *head);
int getBalance(struct AvlNode *p);
int treeHeight(struct AvlNode *p);
#endif