MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / getRandomInt

Function getRandomInt

Data-Structures/Array/QuickSelect.js:56–58  ·  view source on GitHub ↗
(min, max)

Source from the content-addressed store, hash-verified

54}
55
56function getRandomInt(min, max) {
57 return Math.floor(Math.random() * (max - min + 1)) + min
58}
59
60function Swap(arr, x, y) {
61 ;[arr[x], arr[y]] = [arr[y], arr[x]]

Callers 1

RandomizedPartitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected