Post Reply 
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]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Random Integers, No Repeats - lrdheat - 08-09-2023, 02:30 AM
RE: Random Integers, No Repeats - Albert Chan - 08-09-2023 03:15 AM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 04:54 AM
RE: Random Integers, No Repeats - nickapos - 08-09-2023, 04:59 PM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 05:10 PM
RE: Random Integers, No Repeats - lrdheat - 08-09-2023, 01:24 PM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 05:31 PM
RE: Random Integers, No Repeats - nickapos - 08-09-2023, 06:04 PM
RE: Random Integers, No Repeats - parisse - 08-09-2023, 06:09 PM



User(s) browsing this thread: 1 Guest(s)