forked from sinagarajan/Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinarytree.h
More file actions
72 lines (36 loc) · 1.27 KB
/
binarytree.h
File metadata and controls
72 lines (36 loc) · 1.27 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
#include<iostream>
#include<stdio.h>
#include<queue>
#include<stack>
#include<deque>
using namespace std;
struct tree
{
struct tree *left;
struct tree *right;
int data;
};
struct tree * createNode(int data);
struct tree * insertNodeBST(struct tree* root,int data);
struct tree * insertNodeBT(struct tree* root,int data);
void printInorderRecursive(struct tree *root);
void printPreorderRecursive(struct tree *root);
void printPostorderRecursive(struct tree *root);
void findCircumference(struct tree *root);
void printLevelorder(struct tree *root);
int countNode(struct tree *root);
int findMaxBT(struct tree *root);
int findMinBT(struct tree *root);
int findIsBST(struct tree *root);
int findIsBST1(struct tree *root,int min,int max);
void printReverse(struct tree *root);
void printZigZag(struct tree *root);
void printZigZagStack(struct tree *root);
struct tree *findLCA(struct tree * root, int a, int b);
int printMaxHeight(struct tree *root);
void printArray(int paths[],int pathLen);
void printAll(struct tree *root,int path[],int pathLen);
void printAllPaths(struct tree *root);
int printAncestors(struct tree *root,int a);
int findDiameter(struct tree *root);
struct tree * convertSortedArraytoBST(int array[],int start,int end);