data_structures/trees/binaryHeap.py
def __percolate_up(self, start_index):
        """
        Percolate up the element identified by the given index
        :type start_index: int
        :return: None
        """
        current_index = start_index
        parent_index = current_index // 2

        # While the node and its parent are not in the correct order, swap them
        while parent_index > 0 and self.data[current_index] < self.data[parent_index]:
            self._swap(parent_index, current_index)
            current_index = parent_index
            parent_index = current_index // 2

        Percolate up the element identified by the given index
        :type start_index: int
        :return: None
        
Percolate up the element identified by the given index
Percolate up the element identified by the given index
def __percolate_up(self, start_index):
        current_index = start_index
        parent_index = current_index // 2
        while parent_index > 0 and self.data[current_index] < self.data[parent_index]:
            self._swap(parent_index, current_index)
            current_index = parent_index
            parent_index = current_index // 2
def __percolate_up ( self , start_index ) : current_index = start_index parent_index = current_index // 2 while parent_index > 0 and self . data [ current_index ] < self . data [ parent_index ] : self . _swap ( parent_index , current_index ) current_index = parent_index parent_index = current_index // 2
Percolate up the element identified by the given index
Percolate up the element identified by the given index
"""
        Percolate up the element identified by the given index
        :type start_index: int
        :return: None
        """ # While the node and its parent are not in the correct order, swap them
None
self
start_index