Python包含用于min-sheaps的heapq模块,但我需要一个最大堆.我应该在Python中使用什么来实现max-heap实现?
python heap recursive-datastructures data-structures
什么是的大O min和max功能在Python?他们O(n)或者Python有更好的方法来查找数组的最小值和最大值吗?如果它们是O(n),使用for循环来找到所需的值或者它们的工作方式与for循环相同是不是更好?
min
max
O(n)
python algorithm big-o
python ×2
algorithm ×1
big-o ×1
data-structures ×1
heap ×1
recursive-datastructures ×1