Random Iterator in Java
- 2
- Add a Comment
This is some Java code I wrote for a school project to save some time when iterating in random order over a part of list (until some condition becomes true):
import java.util.List;
import java.util.Iterator;
/**
* Provides a random iteration over the given list.
*
* This effect can be achieved by using Collections.shuffle,
* which shuffles the entire collection in linear […]
