+#ifndef BP_H_
+#define BP_H_
+
#include <stdio.h>
#include <stdlib.h>
#include "darray.h"
void loadTree(bp *b, FILE *fp);
void destroyTree(bp *b);
-int blog(int x);
+
+inline int blog(int x)
+{
+ int l;
+ l = 0;
+ while (x>0) {
+ x>>=1;
+ l++;
+ }
+ return l;
+}
+
pb getpat_preorder(pb *b);
pb getpat_leaf(pb *b);
pb getpat_inorder(pb *b);
extern int childtbl[(ETW)*(1<<ETW)];
extern int depthtbl[(2*ETW+1)*(1<<ETW)];
extern int childtbl2[2*ETW+1][ETW][(1<<ETW)];
+
+#endif