aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 1d4f733..3393e89 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,6 +31,7 @@ int main(int argc, char** argv)
print_label(root);
printf("\n");
free_avl_tree_nodes(root);
+ root = NULL;
//-----------------------------------------------
//-LIST-FILES-IN-DIRECTORY-----------------------
//-----------------------------------------------
@@ -169,6 +170,18 @@ int main(int argc, char** argv)
CloseWindow();
#else
if (masks != NULL) {
+ for (size_t y = 0; y < height; y++) {
+ for (size_t x = 0; x < width; x++) {
+ if (masks[x + y*width] != 0) {
+ root = increase_label_area_alloc(root, masks[x + y*width]);
+ }
+ }
+ }
+ printf("Inorder traversal of AVL tree: ");
+ print_label(root);
+ printf("\n");
+ free_avl_tree_nodes(root);
+ root = NULL;
write_array("../out.bin", masks, width*height*sizeof(uint16_t));
free(masks);
}