-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdfQuery.h
More file actions
32 lines (26 loc) · 764 Bytes
/
Copy pathdfQuery.h
File metadata and controls
32 lines (26 loc) · 764 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
#ifndef _DFQUERY_H_
#define _DFQUERY_H_
typedef struct stackNode{
int alternatives; //alternatives of char
char character;
int lastChar; //if last character of word
}stackNode;
typedef struct stack{
int size;
int top;
stackNode* elements;
}stack;
//df's functions
int retDocFrequency(rootNode* root,char* word);
void DFS(trieNode* node,stack* stackWord);
//stack's functions
void initializeStack(stack** stackWord,int size);
void destroyStack(stack** stackWord);
int stackIsEmpty(stack* stackWord);
int stackIsFull(stack* stackWord);
void doubleStack(stack* stackWord);
void stackPush(stack* stackWord,stackNode* node);
stackNode* stackPop(stack* stackWord);
void printStack(stack* stackWord);
void printCurrentStack(stack* stackWord);
#endif