Java program to Select a Random Node from a tree
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static class Node { int data ; int children ; Node left , right ; } static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = temp . right = null ; temp . children = 0 ; return temp ; }