-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree.h
46 lines (31 loc) · 1.19 KB
/
tree.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef INTERPRETER_TREE_H
#define INTERPRETER_TREE_H
#include "heaps.h"
//-----------------------------------------------------
//----------------- A Struct Representing a Node in BST
typedef struct Node
{
char* name;
float value;
struct Node* left;
struct Node*right;
} Node;
//-----------------------------------------------------
//--------------------------------- Creating A New Node
Node* newNode(char* word,float);
//-----------------------------------------------------
//----------------------------- Insert Node To The Tree
Node* insert(Node* Root,char* key,float);
//-----------------------------------------------------
//----------------------------- Search Through The tree
Node* search(Node* root, char* key);
//-----------------------------------------------------
//----------------------------------- InOrder Traversal
void inOrder(Node* root);
//-----------------------------------------------------
//-------------------------------- Num of tree elements
int count(Node* root);
//-----------------------------------------------------
//------------------------------------from tree to heap
void fromTreeToHeap(Node * root,variable heap[]);
#endif //INTERPRETER_TREE_H