Random problems based on various algorithms and data structures in Java