-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.h
More file actions
31 lines (23 loc) · 946 Bytes
/
tree.h
File metadata and controls
31 lines (23 loc) · 946 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
#ifndef TREE_H
#define TREE_H
#include <stdbool.h>
#include "utils.h"
#include "linkedlist.h"
#include "object.h"
typedef struct Tree Tree;
Tree * treeInit ( ObjectType * elementType, void* element );
Tree * treeInitWithPrintProperties ( ObjectType * elementType, void* element, TreePrintProperties * printProperties);
void treeDestroy ( Tree * parentTree );
void * treeGetElement( Tree * parentTree );
void treeAddNodes(Tree * parentTree, int numChildren, ...);
void treeAddNode(Tree * parentTree, Tree * childTree);
void treeAddLeafs( Tree * parentTree, int numChildren, ... );
void treeAddLeaf( Tree * parentTree, void * element );
bool treeIsLeaf( Tree * parentTree );
LinkedList * treeGetChildren(Tree * parentTree);
Tree * treeGetChild(Tree * parentTree, int i);
Tree * treeGetParent(Tree * tree);
int treeGetSize( Tree * parentTree );
void treePrint( Tree * parentTree );
char * treeToString( Tree * parentTree );
#endif // TREE_H