--[[ @brief Reshuffles the heap if a given index is smaller than its parent.
--]]

function Heap:_HeapifyBottomUp(i)
	local parent = math.floor(i / 2);
	while self[parent] and self.Comparator(self[i], self[parent]) do
		self[parent], self[i] = self[i], self[parent];
		i = parent;
		parent = math.floor(i / 2);
	end
end
