Random Sort/Shuffle a List
I'm trying to figure out an efficient method to randomly shuffle a list. Basically an implementation of Fisher/Yates/Knuth algorithm. In order to do this efficiently the best way is to repeatedly swap two elements in a list (or even a map). The built in functions do not seem to allow you directly write to elements in lists. So I end up having to repeatedly create temporary lists. Which is obviously very inefficient and slow.
Can anyone think of a better way to easily swap two elements within the same list.
Any tips or advice much appreciated.
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.