-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneralTree.h
More file actions
24 lines (22 loc) · 864 Bytes
/
GeneralTree.h
File metadata and controls
24 lines (22 loc) · 864 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
#pragma once
#include "LinearLinkedListNode.h"
#ifndef __GENERAL_TREENODE
typedef struct GeneralTreeNode
{
void* data;
LinearLinkedListNode* nextsChildsManager;
}GeneralTreeNode;
#define __GENERAL_TREENODE
#endif // !__GENERAL_TREENODE
//Init the tree
void MakeGenralTree(GeneralTreeNode** , void*);
//Creats leaf number i
void SetLeafI(GeneralTreeNode*, void*);
//Cheacks if givven node is a leaf(dont have childs)
BOOL IsLeafGeneralTreeNode(GeneralTreeNode*);
//Recursive methoods that retruns the amount of nodes in whole tree
int HowManyNodesGeneralTreeNode(GeneralTreeNode*);
//Recursive methoods that retruns the amount of leafs in whole tree
int howManyLeafsGeneralTreeNode(GeneralTreeNode*);
//Recursive method to find node with givven val
GeneralTreeNode* FindNodeGeneralTreeNode(GeneralTreeNode*, void*, BOOL(*isEql)(void*));