-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathADT.txt
More file actions
96 lines (35 loc) · 1.34 KB
/
ADT.txt
File metadata and controls
96 lines (35 loc) · 1.34 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
binaryTree ADT
▶ BTreeNode * MakeBTreeNode(void)
▶ BTData GetData(node * bt)
▶ void SetData(node * bt, BTdata data)
▶ node * GetLeftSubTree(node * bt)
▶ node * GetRightSubTree(node * bt)
▶ void MakeLeftSubTree(node * main, node* sub)
▶ void MakeRightSubTree(node * main, node* sub)
▶ void PreOrderTraverse(node * bt, visitFun)
▶ void InOrderTraverse(node * bt, visitFun)
▶ void PostOrderTraverse(node * bt, visitFun)
▶ void DeleteTree(node * bt)
ExpressionTree ADT
▶ BTreeNode * MakeExpTree(char exp[])
▶ int EvaluateExpTree(BTreeNode * bt)
▶ void ShowPrefixTypeExp(BTreeNode * bt)
▶ void ShowInfixTypeExp(BTreeNode * bt)
▶ void ShowPostfixTypeExp(BTreeNode * bt)
Heap ADT
▶ void HeapInit(Heap * ph)
▶ int HIsEmpty(Heap * ph)
▶ void HInsert(Heap * ph, HData data, Priority pr)
▶ HData HDelete(Heap * ph)
QuickSort ADT
▶ void QuickSort(int arr[], int left, int right)
▶ int Partition(int arr[], int left, int right)
▶ void swap(int arr[], int idx1, int idx2)
AVLRebalance ADT
▶ BTreeNode * RotateLL(BTreeNode * bst)
▶ BTreeNode * RotateRR(BTreeNode * bst)
▶ BTreeNode * RotateLR(BTreeNode * bst)
▶ BTreeNode * RotateRL(BTreeNode * bst)
▶ int GetHeight(BTreeNode * bst)
▶ int GetHeightDiff(BTreeNode * bst)
▷ BTreeNode * Rebalance(BTreeNode ** pRoot)