Skip to content

Comments

KR2SortTree#17

Open
Palezehvat wants to merge 1 commit intomainfrom
sortTree
Open

KR2SortTree#17
Palezehvat wants to merge 1 commit intomainfrom
sortTree

Conversation

@Palezehvat
Copy link
Owner

No description provided.

for (int i = 0; i < size; ++i) {
printf("%d ", arrayOut[i]);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Память не удаляется

}
}

int j = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

О, глобальная переменная, минус два балла :) Надо было передавать как параметр по указателю везде, где она нужна.


#include <stdbool.h>

typedef struct Node Node;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тут, к сожалению, не нужно, потому что этот модуль буквально ничего про tree внешнему миру не предоставляет


typedef struct Node Node;

void addArrayToTree(int arrayOut[], int size);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неудачное название функции. Она не добавляет массив в дерево, она сортирует массив

Comment on lines +17 to +18
Tree* tree = calloc(1, sizeof(tree));
return tree;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tree* tree = calloc(1, sizeof(tree));
return tree;
return calloc(1, sizeof(tree));


void addToTree(Tree* tree, int value) {
if (tree == NULL) {
return ;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ;
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но ещё надо бы как-то просигнализировать вызывающему, что всё плохо


void backOrderClear(Tree* tree) {
helpBackOrderClear(tree->root);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Само tree ещё не удаляется

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants