CPP program to Select a Random Node from a tree
#include <bits/stdc++.h> NEW_LINE using namespace std ; struct Node { int data ; int children ; Node * left , * right ; } ; Node * newNode ( int data ) { Node * temp = new Node ; temp -> data = data ; temp -> left = temp -> right = NULL ; temp -> children = 0 ; return temp ; }