Browse Source

Updated heap.py

luislopez66 2 years ago
parent
commit
05bfd2be7e
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      heap.py

+ 3
- 3
heap.py View File

10
 # i. Also, n is the size of a heap and arr is array.
10
 # i. Also, n is the size of a heap and arr is array.
11
 
11
 
12
 def heapify(lista, n, i):
12
 def heapify(lista, n, i):
13
-		# largest is root for now
13
+        # largest is root for now
14
 		largest = i
14
 		largest = i
15
 
15
 
16
 		# left child of root
16
 		# left child of root
17
-		left = 2 * i + 1
17
+		l = 2 * i + 1
18
 
18
 
19
 		# right child of root
19
 		# right child of root
20
-		right = 2 * i + 2
20
+		r = 2 * i + 2
21
 
21
 
22
 		# Checks if root has a left child and is greater
22
 		# Checks if root has a left child and is greater
23
 		# than root
23
 		# than root