Given a sorted array in increasing order, create a BST of minimum height
Your code will only work one time, because of the static int i in your inorder_traversal function. You have no way to reset i to 0
Splitting creation and filling into two parts is not what I'd call efficient. This way you have to traverse the tree twice: once while creating it and once while filling it. And if you do not depend on a complete binary tree, managing a queue is a wast of time and unnecessary complexity to whom ever is trying to read your code.


My advice would be, work recursive on recursive data. The recursive way is much shorter and much easier to read, isn't it?

node* create_bst(vector&lt;int&gt; const&amp; arr)
{
  return create_bst(arr, 0, arr.size());
}

node* create_bst(vector&lt;int&gt; const&amp; arr, int start, int end)
{
  if (start &gt;= end)
    return null;

  int m = (start + end) / 2;

  node* root = new node(arr[m]);

  root-&gt;left = create_bst(arr, start, m);
  root-&gt;right = create_bst(arr, m + 1, end);

  return root;
}