MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / ensureIndexWithinBounds

Function ensureIndexWithinBounds

Search/UnionFind.js:78–86  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

76 cnt--
77 }
78 function ensureIndexWithinBounds(args) {
79 for (let i = arguments.length - 1; i >= 0; i--) {
80 const p = arguments[i]
81 if (p >= length)
82 throw new Error(
83 'Index out of bounds. The maximum index can be length-1'
84 )
85 }
86 }
87}
88
89export { UnionFind }

Callers 1

UnionFindFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected