Efficiently shuffling a subset of a hashmap

I want to be able to efficiently shuffle a range of a Hashmap's entries (e.g., from key=0 to key=n, where n < the capacity of the hashmap). I want the keys to still point to the initial values, but I want the ordering to change for a subset. What is a good way to do this without pulling a range of key,value pairs out and shuffling them in a separate vector (and thereafter copying the elements in the vector back into the hashmap, which would be very poorly performant)

You can't change the order of items inside of a HashMap, why do you want to do this?


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.