Skip to content

Commit fe95a31

Browse files
committed
Minor fixes for type checking
1 parent 2e35261 commit fe95a31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

data_structures/heap/fibonacci_heap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _insert_into_circular_list(self, base_node, node_to_insert) -> Node:
136136
base_node.right = node_to_insert
137137
return base_node
138138

139-
def extract_min(self) -> Node:
139+
def extract_min(self) -> float:
140140
"""Remove and return the minimum key from the heap.
141141
142142
This operation removes the node with the minimum key from the heap,
@@ -166,7 +166,7 @@ def extract_min(self) -> Node:
166166
the Fibonacci heap properties after removal of the minimum node.
167167
"""
168168
if self.min_node is None:
169-
return Node(None)
169+
return Node(None).key
170170

171171
min_node = self.min_node
172172

@@ -382,7 +382,7 @@ def find_min(self) -> float:
382382
>>> heap.find_min()
383383
3
384384
"""
385-
return self.min_node.key if self.min_node else Node(None)
385+
return self.min_node.key if self.min_node else Node(None).key
386386

387387
def is_empty(self) -> bool:
388388
"""Check if heap is empty.

0 commit comments

Comments
 (0)