Skip to content

Instantly share code, notes, and snippets.

View atiedebee's full-sized avatar

atiedebee atiedebee

View GitHub Profile
@atiedebee
atiedebee / printtree.c
Last active April 17, 2025 13:44
Pretty Binary tree printing
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;