The runtime precondition check rules out negative dimensions:Both links point to the fresh list header, so all reciprocal-link conditions hold and there are no ordinary entries to violate ordering or nonzero-value requirements. The abstraction function therefore yields the zero vector of dimension
def makeZeroVector(size: Int): Node = {
require(size >= 0)
val h = new Node(0.0, size)
h.prev = h
h.next = h
h
}size. Construction uses constant time and constant space. Articles by others on the same topic
There are currently no matching articles.