Random Integers, No Repeats
|
08-09-2023, 03:15 AM
(This post was last modified: 08-09-2023 10:23 AM by Albert Chan.)
Post: #3
|
|||
|
|||
RE: Random Integers, No Repeats
The algorithm is called Fisher–Yates shuffle, with time complexity of O(n)
It is implemented in Python random.shuffle HP Prime has it builtin: CAS> shuffle([1,3,5,7,9]) → [5,1,9,3,7] CAS> shuffle(5) → [2,5,3,4,1] |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)