Skip to content

Algorithms&data structures 7 - #13

Open
SRytv wants to merge 15 commits into
masterfrom
Algorithms&Data_Structures_7
Open

Algorithms&data structures 7#13
SRytv wants to merge 15 commits into
masterfrom
Algorithms&Data_Structures_7

Conversation

@SRytv

@SRytv SRytv commented Oct 17, 2018

Copy link
Copy Markdown
Owner

No description provided.

@Dzhoker1 Dzhoker1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Оставил комментарии по коду

array_SIZE = 10
#==============================================================================

def buble_sort(array):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Отлично по всем пунктам задачи.

if __name__ == "__main__":
array = []
for i in range(array_SIZE):
array.append(random.uniform(0, 50 - 1e-100))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно было просто 50, без вычитаний.

#===========http://www.cyberforum.ru/python/thread395180.html=====================
#=================================================================================

def merge(left, right):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Отличный алгоритм.

# Я потратил много времени нак сортировку слиянием и на что-то еще меня уже не оставалось
print("Сортированный массив:", end=' ')
print(array)
mediana_indx = int((array_SIZE - -1) / 2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

-1 лишний. Иначе получаем соседа медианы.

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