How to traverse a binary search tree diagonally? Any sample algo/code?

How to convert a binary tree into binary search tree keeping the structure of tree intact?