Given an ascending order array, build a balanced Binary Search Tree
1. Choose the middle element from the array
2. Create parent node with the middle element
3. Recur the left subarray and Recur the right subarray
4. Stop if the array have only one element

Note: the algorithm is very similar to merge sort when the tree is built
middle element is used instead of pivot element
class Stack{
    public:
        int maxLen;
        int count;
        char* array;
    public:
        Stack(int max){
            count = 0;
            maxLen = max;
            array = new char[maxLen];
        }
        void push(char ch){
            if(count < maxLen){
                array[count] = ch;
                count++;
            }
        }
        char pop(){
            char ch;
            if(count > 0){
                ch = array[count-1];
                count--;
            }
            return ch;
        }
        bool isEmpty(){
            return count == 0;
        }
        int size(){
            return count;
        }
        ~Stack(){
            if(array)
                delete[] array;
        }
};