@@ -146,7 +146,7 @@ def _bubble_down(self, elem: T) -> None:
146146 _ , weight = self .heap [curr_pos ]
147147 child_left_position = get_child_left_position (curr_pos )
148148 child_right_position = get_child_right_position (curr_pos )
149-
149+
150150 # Check if both children exist
151151 if child_left_position < self .elements and child_right_position < self .elements :
152152 _ , child_left_weight = self .heap [child_left_position ]
@@ -155,15 +155,15 @@ def _bubble_down(self, elem: T) -> None:
155155 self ._swap_nodes (child_right_position , curr_pos )
156156 self ._bubble_down (elem )
157157 return
158-
158+
159159 # Check left child
160160 if child_left_position < self .elements :
161161 _ , child_left_weight = self .heap [child_left_position ]
162162 if child_left_weight < weight :
163163 self ._swap_nodes (child_left_position , curr_pos )
164164 self ._bubble_down (elem )
165165 return
166-
166+
167167 # Check right child
168168 if child_right_position < self .elements :
169169 _ , child_right_weight = self .heap [child_right_position ]
@@ -271,7 +271,7 @@ def prims_algo(
271271 # Main algorithm loop
272272 while not priority_queue .is_empty ():
273273 node = priority_queue .extract_min ()
274-
274+
275275 # Explore neighbors of current node
276276 for neighbor , weight in graph .connections [node ].items ():
277277 # Update if found better connection to tree
0 commit comments