-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtrees.h
31 lines (28 loc) · 1.04 KB
/
trees.h
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
/*
* trees.h
*
* Created on: Oct 12, 2015
* Author: jahnka
*/
#ifndef TREES_H_
#define TREES_H_
using namespace std;
std::vector<int> getDescendants(bool** ancMatrix, int node, int n);
std::vector<int> getNonDescendants(bool**& ancMatrix, int node, int n);
int countBranches(int* parents, int length);
vector<vector<int> > getChildListFromParentVector(int* parents, int n);
void deleteChildLists(vector<vector<int> > &childLists);
string getNewickCode(vector<vector<int> > list, int root);
int* prueferCode2parentVector(int* code, int codeLength);
int* getBreadthFirstTraversal(int* parent, int n);
bool** parentVector2ancMatrix(int* parent, int n);
int* getRandParentVec(int n);
bool* getInitialQueue(int* code, int codeLength);
int* getLastOcc(int* code, int codeLength);
int getNextInQueue(bool* queue, int pos, int length);
void updateQueue(int node, bool* queue, int next);
int updateQueueCutter(int node, bool* queue, int next);
int* starTreeVec(int n);
bool** starTreeMatrix(int n);
int* reverse(int* array, int length);
#endif /* TREES_H_ */