我一直在搜索贝尔曼-福特算法的空间复杂度,但在维基百科贝尔曼-福特算法上,它说空间复杂度是 O(V)。在这个链接上它说 O(V^2) 。我的问题是;什么是真正的空间复杂度,为什么?
algorithm space-complexity graph-algorithm bellman-ford
algorithm ×1
bellman-ford ×1
graph-algorithm ×1
space-complexity ×1