-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path103-main.c
More file actions
30 lines (27 loc) · 776 Bytes
/
103-main.c
File metadata and controls
30 lines (27 loc) · 776 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
#include <stdlib.h>
#include <stdio.h>
#include "binary_trees.h"
/**
* main - Entry point
*
* Return: 0 on success, error code on failure
*/
int main(void)
{
binary_tree_t *root;
root = binary_tree_node(NULL, 98);
root->right = binary_tree_node(root, 128);
root->right->right = binary_tree_node(root->right, 402);
binary_tree_print(root);
printf("Rotate-left %d\n", root->n);
root = binary_tree_rotate_left(root);
binary_tree_print(root);
printf("\n");
root->right->right = binary_tree_node(root->right, 450);
root->right->left = binary_tree_node(root->right, 420);
binary_tree_print(root);
printf("Rotate-left %d\n", root->n);
root = binary_tree_rotate_left(root);
binary_tree_print(root);
return (0);
}