Skip to content

Comments

Homework5 task2#4

Open
shannami wants to merge 17 commits intomainfrom
homework5Task2
Open

Homework5 task2#4
shannami wants to merge 17 commits intomainfrom
homework5Task2

Conversation

@shannami
Copy link
Owner

Шалахина Анна дз 5.2

@shannami shannami requested a review from WoWaster October 16, 2025 16:53
Copy link
Collaborator

Choose a reason for hiding this comment

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

Интересно, а здесь CMake файлов нет (да и не надо уже, наверное, сделаете отдельный PR для нужной домашки)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Претензии к стеку такие же, как и в соседнем PR

return c == '+' || c == '-' || c == '*' || c == '/';
}

int isDigit(char c)
Copy link
Collaborator

Choose a reason for hiding this comment

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

void infixToPostfix(char* infix, char* postfix)
{
struct Stack st = new();
int rpn = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Я абсолютно без идей, что это значит

return c >= '0' && c <= '9';
}

void infixToPostfix(char* infix, char* postfix)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Идея с тем, чтобы заставить пользователя самому выделять выходную строку имеет место быть, но в таком случае нужно описать, сколько должен выделить пользователь, поскольку на самом деле это не очевидно. Кажется, что верхняя оценка 2 * strlen(infix).

Comment on lines 39 to 40
if (top == '(')
break;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Кажется, здесь происходит какая-то ошибка, но пользователь об этом ни сном, ни духом :(

Comment on lines 55 to 56
postfix[rpn] = '\0';
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

А память-то течёт...

Copy link
Collaborator

Choose a reason for hiding this comment

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

И возможно стоит ругаться на неподдерживаемые символы

Copy link
Collaborator

@WoWaster WoWaster left a comment

Choose a reason for hiding this comment

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

  1. Добавлять пробелы в вывод
  2. Сделать условие if более явным.
  3. Писать комментарии над

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