--[[ @brief Finds the object in the heap and reduces its value.
     @details Note: this is not an efficient operation. It runs in O(n) time where n is the size of the heap.
--]]

function Heap:HeapifyObject(element)
	for i = 1, #self do
		if self[i] == element then
			self:_HeapifyBottomUp(i);
			break;
		end
	end
end

function Heap.new()
	return setmetatable({}, Heap.Meta);
end

return Heap;
