Skip to content

Comments

ДЗ №4 Оптимальная сортировка Максим Ипатов#3

Open
imaxde wants to merge 9 commits intomainfrom
06oct25
Open

ДЗ №4 Оптимальная сортировка Максим Ипатов#3
imaxde wants to merge 9 commits intomainfrom
06oct25

Conversation

@imaxde
Copy link
Owner

@imaxde imaxde commented Oct 23, 2025

Сортировка слиянием на языке ассемблера и основной файл на C

@imaxde imaxde requested a review from WoWaster October 23, 2025 17:51
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.

Приложите ещё исходный .c файл.

Comment on lines 6 to 8
int number;
int data[100];
int original_data[100];
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

Suggested change
int number;
int data[100];
int original_data[100];
int number = 0;
int data[100] = { };
int originalData[100] = { };


while (scanf("%d", &number) == 1) {
data[index] = number;
original_data[index] = number; // сохраняем копию исходного массива
Copy link
Collaborator

Choose a reason for hiding this comment

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

Комментарии лучше писать над сущностью.

#pragma once

/* Сортировка слиянием */
void merge_sort(int data[], int size); No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

По стайлгайду mergeSort

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.

Я вот так сходу не уверен, что Вы собрали этот код с оптимизациями.

printf("\n");

// подсчитываем различия
int moved_count = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
int moved_count = 0;
int movedCount = 0;

@imaxde imaxde requested a review from WoWaster December 22, 2025 20:34
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