-
Notifications
You must be signed in to change notification settings - Fork 0
/
121-main.c
41 lines (39 loc) · 1.04 KB
/
121-main.c
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
37
38
39
40
41
#include <stdlib.h>
#include <stdio.h>
#include "binary_trees.h"
/**
* main - Entry point
*
* Return: 0 on success, error code on failure
*/
int main(void)
{
avl_t *root;
avl_t *node;
root = NULL;
node = avl_insert(&root, 98);
printf("Inserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 402);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 12);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 46);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 128);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 256);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 512);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
node = avl_insert(&root, 50);
printf("\nInserted: %d\n", node->n);
binary_tree_print(root);
return (0);
}