Test Case Generation | Set 6 (Random Unweighted Binary Tree)

  #include using namespace std;    vector generateBinaryTree(int n){                        vector options = { 0, 1, 2 };                        map mp;                queue q;            q.push(1);            vector v;                int count = 1;                mp[1] = 1;            while (!q.empty() or count < n) {                                            int front;                  if(!q.empty()) {                                                    front = q.front();                                                                q.pop();        }                                                          int numberOfChilds          = options[rand() % (options.size())];                            if (count >= n)            continue;                                        while (numberOfChilds–) {                                                                int child = rand() % n + 1;                                        while (mp[child]) {                child++;                if (child > n) {                    child = 1;                }            }                                        count++;                            mp[child] = 1;                                        v.push_back({ front, child });                            q.push(child);                                        if (count == n)                break;        }    }            random_shuffle(v.begin(), v.end());      return v;}    void printTree(int n, vector v){    int s = v.size();            cout