-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path101-main.c
More file actions
36 lines (32 loc) · 743 Bytes
/
101-main.c
File metadata and controls
36 lines (32 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdlib.h>
#include <stdio.h>
#include "binary_trees.h"
/**
* print_num - Prints a number
*
* @n: Number to be printed
*/
void print_num(int n)
{
printf("%d\n", n);
}
/**
* main - Entry point
*
* Return: Always 0 (Success)
*/
int main(void)
{
binary_tree_t *root;
root = binary_tree_node(NULL, 98);
root->left = binary_tree_node(root, 12);
root->right = binary_tree_node(root, 402);
root->left->left = binary_tree_node(root->left, 6);
root->left->right = binary_tree_node(root->left, 56);
root->right->left = binary_tree_node(root->right, 256);
root->right->right = binary_tree_node(root->right, 512);
binary_tree_print(root);
binary_tree_levelorder(root, &print_num);
binary_tree_delete(root);
return (0);
}