use some functions like findminimum ,find maximum after all it is also a binary tree....................