-
Notifications
You must be signed in to change notification settings - Fork 77
7 домашняя работа #575
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: master
Are you sure you want to change the base?
7 домашняя работа #575
Conversation
| is_sort = False # если были переставлены элементы, то массив считается не отсортированным | ||
| if is_sort: # в теле цикла проверили были ли изменения, прошли по всему массиву, если всё ок, ты выходим. | ||
| break | ||
| ''' |
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.
Нина, а зачем на вход подавать упорядоченный массив?
зачем сортировка, если массив уже упорядочен
нужно передавать неупорядоченный
|
|
||
| print(data) | ||
| merge_sort(data) | ||
| print(data) |
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.
слияние реализовано
| print(f'Медиана = {median(data)}') | ||
| print(data) | ||
| print(sorted(data)) | ||
|
|
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.
здесь тоже хороши бы итоговые выводы - применили сортировку или нет и т.д.
No description provided.