(self)
| 56 | return None |
| 57 | |
| 58 | def heapSort(self): #This function is used to sort the heap. |
| 59 | size = self.currsize |
| 60 | while self.currsize-1 >= 0: |
| 61 | temp = self.h[0] |
| 62 | self.h[0] = self.h[self.currsize-1] |
| 63 | self.h[self.currsize-1] = temp |
| 64 | self.currsize -= 1 |
| 65 | self.maxHeapify(0) |
| 66 | self.currsize = size |
| 67 | |
| 68 | def insert(self,data): #This function is used to insert data in the heap. |
| 69 | self.h.append(data) |