Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct AVL
- {
- int value;
- unsigned char height;
- AVL *left, *right;
- };
- struct AVL
- {
- AVL *left, *right;
- int value;
- unsigned char height;
- };
- #pragma pack(push, 1)
- struct AVL
- {
- int value;
- unsigned char height;
- AVL *left, *right;
- };
- #pragma pack(pop)
- void bst_to_avl(BST *tree, AVL **root)
- {
- if (tree && root)
- {
- *root = avl_add(*root, tree->value);
- bst_to_avl(tree->left, root);
- bst_to_avl(tree->right, root);
- }
- }
- #ifndef _BST_H_
- #define _BST_H_
- typedef struct BST BST;
- struct BST
- {
- BST *left, *right;
- int value;
- };
- BST *bst_add(BST *root, int num);
- void bst_free(BST *root);
- int count_peaks(BST *root);
- #endif
- CC := gcc
- CFLAGS := -std=c99 -Wall -Werror
- ifeq ($(mode), debug)
- CFLAGS += -g3
- endif
- -include *.d
- main.o: main.c *.h
- $(CC) -MMD $(CFLAGS) -c $<
- %.o: %.c %.h
- $(CC) -MMD $(CFLAGS) -c $<
- app.exe: main.o io.o BST.o AVL.o bst_to_avl.o arrgen.o hash_table.o search.o restruct.o
- $(CC) $^ -o $@
- clean:
- rm *.o *.d *.exe
Add Comment
Please, Sign In to add comment