Skip to main content

All Questions

Tagged with
-1 votes
1 answer
2k views

Generating billions of Unique random number [closed]

I recently attended an interview. In that I had to solve the issue for generating an billions of random unique number. For example method signature is as below : public Iterator<Long> ...
MrA's user avatar
  • 111
2 votes
1 answer
1k views

How to randomly get or find a sub-tree (include root node) from a given tree that contains n leaf-nodes

I have a non-binary tree. I want to randomly find a "sub-trees" that are connected from root to leaf which must have at least n leaf-nodes (leaf-nodes of sub-tree must be leaf-nodes of given tree). ...
Hung Ton's user avatar
  • 123
3 votes
1 answer
185 views

Defining a random "safe" path for a game character

I am writing a game in Java and it can be likened to the recently popular game "Flappy Bird" in the sense that the character moves up and down and the users touch and must avoid the obstacles. The ...
Críostóir Ó Catháin's user avatar
3 votes
2 answers
2k views

Which of these two shuffle algorithms is more random?

Which of below two shuffle algorithms (shuffle1 and shuffle2) is more random? public final class Shuffle { private static Random random; public static void shuffle1(final Object[] array) { ...
robosoul's user avatar
  • 133