-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path111-main.c
More file actions
36 lines (34 loc) · 923 Bytes
/
111-main.c
File metadata and controls
36 lines (34 loc) · 923 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"
/**
* main - Entry point
*
* Return: Always 0 (Success)
*/
int main(void)
{
bst_t *root;
bst_t *node;
root = NULL;
node = bst_insert(&root, 98);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 402);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 12);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 46);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 128);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 256);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 512);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 1);
printf("Inserted: %d\n", node->n);
node = bst_insert(&root, 128);
printf("Node should be nil -> %p\n", (void *)node);
binary_tree_print(root);
return (0);
}