This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Node{ | |
int val; | |
struct Node* l; | |
struct Node* r; | |
}; | |
// call with (head, 0, 0) | |
static void printtree(struct Node* h, size_t depth, int leaf){ | |
static int stack[128]; | |
stack[depth] = leaf; |