Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
56
function
getRandomInt(min, max) {
57
return
Math.floor(Math.random() * (max - min + 1)) + min
58
}
59
60
function
Swap(arr, x, y) {
61
;[arr[x], arr[y]] = [arr[y], arr[x]]
Callers
1
RandomizedPartition
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected