Conversation
There was a problem hiding this comment.
Андрей! Вы читали, что я Вам про такую раскладку директорий писал????? Ну не работает оно так :(
| newNode->count = 1; | ||
| newNode->next = NULL; | ||
|
|
||
| newNode->next = list->head; |
There was a problem hiding this comment.
А зачем Вы стали делать циклический список?
| ListNode* current = list->head; | ||
| while (current->next != NULL && current->next->value < value) { | ||
| current = current->next; | ||
| // printf("%d", current->next->value); |
| return; | ||
| } else if (current->value == value) { | ||
| current->count++; | ||
|
|
There was a problem hiding this comment.
Или здесь return не хватает, или просто нигде не нужен был
| List* newList(); | ||
| void insert(List* list, int value); | ||
| bool deleteNode(List* list, int value); | ||
| void printList(List* list); | ||
| void deleteList(List* list); No newline at end of file |
There was a problem hiding this comment.
Комментарии традиционно пишут в хедере
There was a problem hiding this comment.
Ну, память вроде не течёт. И идея здравая, странности есть, но это ведь контрольная :)
| if (list->head->value == 0) { | ||
| current = current->next; | ||
| miniNumber += current->value * pow(10, degree); | ||
| degree--; | ||
| degree = degree - tempDegree; | ||
| } |
There was a problem hiding this comment.
Что происходит здесь я, честно говоря, так себе понимаю.
| while (current != NULL) { | ||
| for (int i = 0; i < current->count; i++) { | ||
| miniNumber += current->value * pow(10, degree); | ||
| degree--; | ||
| } | ||
| current = current->next; | ||
| } |
There was a problem hiding this comment.
Но вообще похоже на правду
There was a problem hiding this comment.
Вот были бы здесь тесты. А так я даже не понимаю, работает ли оно или нет :(
No description provided.