mirror of
https://github.com/opus-tango/DSA-reference.git
synced 2026-03-20 03:55:22 +00:00
27 lines
468 B
C
27 lines
468 B
C
#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);
|
|
void _recursive_print_node(Node* node, int level);
|
|
|
|
Node* get_left(Node* node);
|
|
Node* get_right(Node* node);
|
|
|
|
void set_left(Node* parent, Node* child);
|
|
void set_right(Node* parent, Node* child);
|