mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Enable ruff PLR5501 rule (#11332)
* Enable ruff PLR5501 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -40,11 +40,10 @@ class BinaryHeap:
|
||||
while self.__size >= 2 * i:
|
||||
if 2 * i + 1 > self.__size:
|
||||
bigger_child = 2 * i
|
||||
elif self.__heap[2 * i] > self.__heap[2 * i + 1]:
|
||||
bigger_child = 2 * i
|
||||
else:
|
||||
if self.__heap[2 * i] > self.__heap[2 * i + 1]:
|
||||
bigger_child = 2 * i
|
||||
else:
|
||||
bigger_child = 2 * i + 1
|
||||
bigger_child = 2 * i + 1
|
||||
temporary = self.__heap[i]
|
||||
if self.__heap[i] < self.__heap[bigger_child]:
|
||||
self.__heap[i] = self.__heap[bigger_child]
|
||||
|
Reference in New Issue
Block a user