Skip to content

Conversation

@kamendov-maxim
Copy link
Owner

No description provided.

Comment on lines +12 to +16
// if (!test())
// {
// printf("Программа не работает\n");
// return PROGRAM_FAILED_TESTS;
// }

Choose a reason for hiding this comment

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

Закомментированный код не нужен

Node *head;
} Queue;

Queue *createQueue(void){

Choose a reason for hiding this comment

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

Suggested change
Queue *createQueue(void){
Queue *createQueue(void)
{

return (Queue *)calloc(1, sizeof(Queue));
}

ErrorCode enqueue(Queue * const queue,const int value, const size_t priority)

Choose a reason for hiding this comment

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

Suggested change
ErrorCode enqueue(Queue * const queue,const int value, const size_t priority)
ErrorCode enqueue(Queue * const queue, const int value, const size_t priority)

free(currentNode);
}
free(queue);
queue = NULL;

Choose a reason for hiding this comment

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

Оно так не работает. Надо было принимать queue как Queue**, иначе тут просто в локальный параметр запишется NULL, и вызывающий про это ничего не узнает


typedef struct Queue Queue;

ErrorCode enqueue(Queue * const queue,const int value, const size_t priority);

Choose a reason for hiding this comment

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

Надо было комментарии к каждой функции в заголовочном файле

} Command;

const bool testCase(Command const *const commands, size_t const *const priorities,
int const *const answers, const size_t testLen, const int * const values)

Choose a reason for hiding this comment

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

Тут надо отступ, потому что это продолжение предыдущей строки.

Comment on lines +59 to +62
const bool test(void)
{
return true;
}

Choose a reason for hiding this comment

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

Всё для тестов написали, а сами тесты — нет. Обидно :)

#define PROGRAM_FAILED_TESTS 1
#define MEMORY_ERROR 2

int main(int, char **)

Choose a reason for hiding this comment

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

Оно так не умеет, надо имена параметров или убрать их вовсе

Node *head;
} Queue;

Queue *createQueue(void){

Choose a reason for hiding this comment

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

И что-то её в хедер не вынесли

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.

2 participants