add node struct to c binary tree

This commit is contained in:
Nayan Sawyer
2025-11-16 11:58:56 -05:00
parent 38854e9b53
commit dc937a738f
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#ifndef BINARY_TREE_H
#define BINARY_TREE_H
#include <stdio.h>
#include <stdlib.h>
#endif
typedef struct Node {
int data;
struct Node* left;
struct Node* right;
} Node;
Node* create_node(int data);
void free_node(Node* node);
void print_node(Node* node);
Node* get_left(Node* node);
Node* get_right(Node* node);
void set_left(Node* parent, Node* child);
void set_right(Node* parent, Node* child);