Skip to content

Conversation

@kamendov-maxim
Copy link
Owner

No description provided.

Choose a reason for hiding this comment

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

В PR не должно быть изменений в файлах, не связанных с задачей.

#include <stdbool.h>
#include <stdlib.h>

int mostFrequentElement(int array[], int size);

Choose a reason for hiding this comment

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

Принято передавать массив в функцию по указателю
Размеры и индексы храним в size_t.

void printArray(int array[], int size);

bool test(void);
bool testStarterForMostFrequentELement(int testArray[], int size, int answer);

Choose a reason for hiding this comment

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

testStarter -> testCase

bool testStarterForMostFrequentELement(int testArray[], int size, int answer);
bool testMostFrequentElementFunction(void);

int main()

Choose a reason for hiding this comment

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

main(void)

if (!test())
{
printf("\nSorry but the program does not work correctly\n");
return 1;

Choose a reason for hiding this comment

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

коды ошибок и возврата выносим в define

Comment on lines 154 to 157
if (rightElement < leftElement)
{
return 2;
}

Choose a reason for hiding this comment

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

убрать

Comment on lines 162 to 166
if (errorCode != 0)
{
return 1;
}
return 0;

Choose a reason for hiding this comment

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

убрать

smartQuickSort(array, currentSeparator + 1, rightElement);
}
return 0;
} No newline at end of file

Choose a reason for hiding this comment

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

Перенос строки в конце файла

int smartQuickSort(int array[], int leftElement, int rightElement);

// a function for testing the work of quick sort
bool testSmartQuickSort(void); No newline at end of file

Choose a reason for hiding this comment

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

Перенос строки в конце файла

return true;
}

bool testSmartQuickSortFunction(void)

Choose a reason for hiding this comment

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

static и все функции, которые не нужны вне модуля делаем static

Copy link

@Firsov62121 Firsov62121 left a comment

Choose a reason for hiding this comment

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

решение этой задачи должно быть в отдельной папке, не связанной с задачей самый частый элемент

Choose a reason for hiding this comment

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

убрать из PR все файлы не связанные с задачей

Choose a reason for hiding this comment

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

тут не должно быть изменений в других файлах, не надо удалять сами файлы.
сейчас после заливки этого PR в main удалятся старые решения, такого быть не должно
научиться делать git rebase и исправить/удалить все коммиты, в которых добавлялись / удалялись эти файлы.

return testSmartQuickSort() && testMostFrequentElement();
}

ExitCode main()

Choose a reason for hiding this comment

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

int main(void)

Comment on lines +21 to +22
&& mostFrequentElement(testArray2, testSize2) == answer2
&& mostFrequentElement(testArray3, testSize3) == answer3;

Choose a reason for hiding this comment

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

отступы выровнять: все строки после первой на 4 пробела дальше, чем первая

Comment on lines +24 to +26
return memcmp(testArray1, answerArray1, testSize1) == 0
&& memcmp(testArray2, answerArray2, testSize2) == 0
&& memcmp(testArray3, answerArray3, testSize3) == 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