Quote Originally Posted by ideru
i agree with _uj

first try to create the BST then do a search right and left ..
Well, I didn't suggest a BST to be built In my reply #15 I suggested an O(log N) solution based on two slightly modified standard binary searches.