-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
42 lines (30 loc) · 751 Bytes
/
Copy pathstack.h
File metadata and controls
42 lines (30 loc) · 751 Bytes
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
/*
Group No: 26
Authors:
Nithin Benny Myppan - 2016A7PS0014P
Adhitya Mamallan - 2016A7PS0028P
Swarup N - 2016A7PS0080P
Naveen Unnikrishnan - 2016A7PS0111P
*/
#ifndef _STACK_H
#define _STACK_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "NaryTree.h"
typedef struct _stackNode{
TreeNode* parseTreeNode;
struct _stackNode* next;
}StackNode;
typedef struct _stack{
StackNode* head;
int size;
}Stack;
Stack* initializeStack();
StackNode* createStackNode(TreeNode* treeNode);
StackNode* pop(Stack* stack);
StackNode* top(Stack* stack);
void push(Stack* stack, TreeNode* treeNode);
void pushChildrenToStack(Stack* stack, TreeNode* treeNode);
bool bottomOfStack(Stack* stack);
#endif