mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Make some ruff fixes (#8154)
* Make some ruff fixes * Undo manual fix * Undo manual fix * Updates from ruff=0.0.251
This commit is contained in:
@@ -44,10 +44,7 @@ class Heap:
|
||||
temp = position[index]
|
||||
|
||||
while index != 0:
|
||||
if index % 2 == 0:
|
||||
parent = int((index - 2) / 2)
|
||||
else:
|
||||
parent = int((index - 1) / 2)
|
||||
parent = int((index - 2) / 2) if index % 2 == 0 else int((index - 1) / 2)
|
||||
|
||||
if val < heap[parent]:
|
||||
heap[index] = heap[parent]
|
||||
|
||||
Reference in New Issue
Block a user