Skip to content

kr 2#8

Open
stuffacc wants to merge 1 commit intomainfrom
kr2
Open

kr 2#8
stuffacc wants to merge 1 commit intomainfrom
kr2

Conversation

@stuffacc
Copy link
Owner

No description provided.

@stuffacc stuffacc requested a review from chernishev December 12, 2025 14:44
Copy link

@Godrik0 Godrik0 left a comment

Choose a reason for hiding this comment

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

Это не биномиальная куча, за наличие какой-то структуры 4 балла
4/30

self.trees.remove(min_node)

if min_node.child:
self.merge(BHeap(min_node.child))
Copy link

Choose a reason for hiding this comment

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

BHeap ожидает список, а Вы передаете объект Node

Comment on lines +20 to +23
trees = []

def __init__(self, trees):
self.trees = trees
Copy link

Choose a reason for hiding this comment

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

trees = [] создает общий для всех экземпляров класса список, но self.trees = trees его перекрывает

Comment on lines +40 to +41
def merge(self, heap):
self.trees.extend(heap.trees)
Copy link

Choose a reason for hiding this comment

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

Это просто объединение двух списков

Comment on lines +58 to +59
if min_node.child:
self.merge(BHeap(min_node.child))
Copy link

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.

2 participants