The short answer is: you can't. A BST requires that the nodes follow the rule left <= current < right. In the example you linked: http://upload.wikimedia.org/wikipedia/commons/f/f7/Binary_tree.svg, if you try and build a BST with the same shap you'll find that you can't.
However if you want to stretch the definition of a BST so that it allows left <= current <= right (notice that here current <= right is allowed, as apposed to the stricter definition) you can. Sort all the elements and stick them in an array. Now do an in-order traversal, replacing the values at nodes with each element in your array. Here's some pseudo code:
// t is your non-BST tree, a is an array containing the sorted elements of t, i is the current index into a
index i = 0
create_bst(Tree t, Array a)
{
if(t is NIL)
return;
create_bst(t->left, a)
t->data = a[i]
i++
create_bst(t->right, a)
}
The result won't be a true BST however. If you want a true BST that's as close to the original shape as possible, then you again put the elements in a sorted array but this time insert them into a BST. The order in which you insert them is defined by the sizes of the subtrees of the original tree. Here's some pseudo-code:
// left is initially set to 0
create_true_bst(Tree t, BST bt, array a, index left)
{
index i = left + left_subtree(t)->size
bt->insert(a[i])
if(left_subtree(t)->size != 0)
{
create_true_bst(t->left, bt, a, left)
create_true_bst(t->right, bt, a, i + 1)
}
}
This won't guarantee that the shape is the same however.