Skip to content

lesson 7#9

Open
serg0761 wants to merge 1 commit into
lesson-1from
lesson-7
Open

lesson 7#9
serg0761 wants to merge 1 commit into
lesson-1from
lesson-7

Conversation

@serg0761
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@Dzhoker1 Dzhoker1 left a comment

Choose a reason for hiding this comment

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

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

Comment thread 7.1.py
new_arr = copy.deepcopy(array)
n = 1
k = False
while n < len(new_arr) and k is not True:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

while n < len(new_arr) and not k:

Comment thread 7.2.py
array = [random.random() * 50 for _ in range(SIZE)]


def merge_step(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.

Отличное решение

Comment thread 7.3.py

def get_median(array):
median_index = (len(array) - 1) / 2 + 1
new_array = collections.Counter(copy.deepcopy(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.

Если в других задачах я не стал писать про copy (хотя там можно обойтись и без них. Всё же при сортировке массива в 10 Гб - копия очень усложнить работы), то тут напишу.
new_array = collections.Counter(array)

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