mirror of
https://github.com/ada-dmitry/prog.l_ada.git
synced 2026-09-24 09:10:14 +00:00
restruct 1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "head.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
// Дерево улетает в SF
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
tree *root = NULL;
|
||||
root = init_root(root, 'A');
|
||||
preorder(root);
|
||||
|
||||
root = add_node(root, 'r');
|
||||
preorder(root);
|
||||
|
||||
root = del_node(root, 'A');
|
||||
preorder(root);
|
||||
|
||||
exit(0);
|
||||
// preorder(root);
|
||||
printf("\n");
|
||||
root = add_node(root, 'F');
|
||||
root = add_node(root, 'B');
|
||||
root = add_node(root, 'D');
|
||||
root = add_node(root, 'G');
|
||||
root = add_node(root, 'C');
|
||||
root = add_node(root, 'H');
|
||||
preorder(root);
|
||||
printf("\n");
|
||||
postorder(root);
|
||||
printf("\n");
|
||||
inorder(root);
|
||||
printf("\n");
|
||||
root = del_node(root, 'B');
|
||||
preorder(root);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user