Skip to content

Comments

Всё сделал#4

Open
Palezehvat wants to merge 1 commit intomainfrom
KRNumber2
Open

Всё сделал#4
Palezehvat wants to merge 1 commit intomainfrom
KRNumber2

Conversation

@Palezehvat
Copy link
Owner

No description provided.

if (arrayEvenNumbered == NULL) {
return;
}
for (int i = 0; i < size; ++i) {

Choose a reason for hiding this comment

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

Suggested change
for (int i = 0; i < size; ++i) {
for (int i = 0; i < size - 1; ++i) {

А то последняя итерация цикла будет впустую

void sortEvenNumberedPositions(int* arrayOut, int size) {
int* arrayEvenNumbered = (int*)calloc(size, sizeof(int));
if (arrayEvenNumbered == NULL) {
return;

Choose a reason for hiding this comment

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

Надо как-то вызывающему сигнализировать, что всё плохо

}
}
bubbleSort(arrayEvenNumbered, j);
int k = 0;

Choose a reason for hiding this comment

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

Надо какие-то более цивилизованные имена переменных

}
bubbleSort(arrayEvenNumbered, j);
int k = 0;
int i = 0;

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.

3 participants