-
Notifications
You must be signed in to change notification settings - Fork 0
Сортировочная станция #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| size_t strl = stack->length * 2; | ||
| addToString(stack->head, output, strl - 2); | ||
| output[strl -1 ]= '\0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поправить пробелы
| output[strl -1 ]= '\0'; | ||
| return output; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лишний перенос
| return NULL; | ||
| } | ||
| size_t strl = stack->length * 2; | ||
| addToString(stack->head, output, strl - 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
переделать на цикл
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
через указатели на предыдущие элементы?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по стеку идём вперёд, по строке назад
|
|
||
| // получить строку со всеми значениями стека, где самый правый элемент - самый верхний элемент стека | ||
| char *createString(Stack const *const stack, StackErrorCode *errorCode); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лишний перенос
| char topElement(Stack const *const stack, StackErrorCode *const errorCode); | ||
|
|
||
| // получить строку со всеми значениями стека, где самый правый элемент - самый верхний элемент стека | ||
| char *createString(Stack const *const stack, StackErrorCode *errorCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
| #include <stdio.h> | ||
|
|
||
| // получить строку из *file до разделителя endOfLine | ||
| char *getString(FILE * file, char const endOfLine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* const
| while (ec != emptyStack && top != '(' && comparison != -1) | ||
| { | ||
| char operatorFromStack = getElement(operatorsStack, &ec); | ||
| ec = addElement(outputStack, operatorFromStack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проверить код ошибки
| } | ||
| } | ||
| ec = moveToOutputStack(outputStack, operatorsStack); | ||
| char *output = createString(outputStack, &ec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
удалить оба стека
|
Разве для переделки рекурсии на цикл не придется излишне усложнить стек? |
| return NULL; | ||
| } | ||
| size_t strl = stack->length * 2; | ||
| addToString(stack->head, output, strl - 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по стеку идём вперёд, по строке назад
| output[i + 1] = ' '; | ||
| } | ||
|
|
||
| char *createString(Stack const *const stack, StackErrorCode *errorCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
No description provided.