This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
I have SortedMap and need to remove a given number of elements from there in random order (i.e. it doesn't matter which elements will be removed, but they should be random)
Do you have any idea of how to do that in effective way?
posted 7 years ago
Dump all the keys into a List; Pick a random element from the List; remove the corresponding mapping fromt he Map
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter