Java program to find rank of an element in a stream .
class GfG { static class Node { int data ; Node left , right ; int leftSize ; } static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = null ; temp . right = null ; temp . leftSize = 0 ; return temp ; }