Conversation
advancBalancStap.c
Outdated
| #include <stdlib.h> | ||
| #include <string.h> | ||
|
|
||
| void balance(char* str, int lenght) |
build/CMakeCache.txt
Outdated
| @@ -0,0 +1,366 @@ | |||
| # This is the CMakeCache file. | |||
| # For build in directory: /home/andrew/src2/build | |||
| # It was generated by CMake: /usr/bin/cmake | |||
There was a problem hiding this comment.
Вот тут где-то имеется в виду, что этому файлу не место в репозитории.
| @@ -0,0 +1,84 @@ | |||
| set(CMAKE_C_COMPILER "/usr/bin/cc") | |||
There was a problem hiding this comment.
Ну и в целом всей build директории не место.
stack.c
Outdated
| struct StackNode* next; | ||
| }; | ||
|
|
||
| // делаем ссулку на голову |
stack.c
Outdated
| #include "stack.h" | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| // #include<stdbool.h> |
There was a problem hiding this comment.
Nit: в комментариях не должно быть "старого" кода. Для этого есть git.
stack.c
Outdated
| struct StackNode* head; | ||
| }; | ||
|
|
||
| // создаем пустую тсруктуру с пустой ссылкой на нулевую голову |
stack.c
Outdated
Comment on lines
64
to
68
| char peek(struct Stack* stack) | ||
| { | ||
| char result = stack->head->value; | ||
| return result; | ||
| } |
There was a problem hiding this comment.
Немного неожиданно, что peek() и pop() ведут себя по-разному. В смысле, первый в случае пустого стека вызовет неопределенное поведение, второй -- вернет \0
stack.c
Outdated
|
|
||
| void deleteStack(struct Stack* stack) | ||
| { | ||
| while (!isEmpty(stack)) { |
There was a problem hiding this comment.
Minor: хорошо перед этим проверить if (stack == NULL) return. Так можно не бояться того, что "почистим" неинициализированный стек. Иногда может быть удобно.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.