common.h (580B)
1 #ifndef COMMON_H_ 2 #define COMMON_H_ 3 4 #include <assert.h> 5 #include <reading.h> 6 #include <stdint.h> 7 #include <stdio.h> 8 9 #define ALPHABET_SIZE ('z' - 'a' + 1) 10 11 typedef struct { 12 int64_t v; 13 char op; 14 size_t opl; 15 size_t opr; 16 } monki; 17 18 size_t monkindex(char *name); 19 size_t left_tree_root(const monki *m); 20 size_t right_tree_root(const monki *m); 21 monki *parse(char **lines, size_t nlines); 22 int64_t mcompute(const size_t start, const monki *m); 23 int humn_subtree(const size_t start, const monki *m); 24 int64_t reverse(const size_t start, const monki *m, const int64_t desired); 25 26 #endif