how to sort the binary search tree with the "stack"or "queue"

how to use stack or queue to sort the BST.
the new idea.
sort LNR:
while(!empty)
{push(p->right);
push(p->info);
cout<<the val<<end;
p=p->left;
}
that just the idea;
please answers hurry,that just the exercise, not the final text.
the final text.
Use array not linked list,to building the BTS have :
input the tree with the BTS.
input any tree and push more NULL node to full BTS.
sort with queue or stack automatic with the best time ot the best ???(which to save the best the things on RAM :))
if you have the new idea,please share on c++,that small to share,the bid to take.
THANKS SO MUCH.
Topic archived. No new replies allowed.