Level order traversal by converting N-ary Tree into adjacency list representation with K as root node

#include using namespace std;  struct Node {    int data;    vector child;};  Node* newNode(int key){    Node* temp = new Node;    temp->data = key;    return temp;}  vector adj;  void DFS(struct Node* node){        for (auto x : node->child) {        if (x != NULL) {                                      adj[node->data].push_back(x->data);            adj[x->data].push_back(node->data);                          DFS(x);        }    }}  void levelOrderTrav(int s, int N){            queue q;              vector visited(N);      q.push(s);          q.push(-1);    visited[s] = true;    while (!q.empty()) {                  int v = q.front();        q.pop();                  if (v == -1) {            if (!q.empty())                q.push(-1);                          cout child).push_back(newNode(4));    (root->child).push_back(newNode(5));    (root->child[0]->child).push_back(newNode(6));    (root->child[0]->child).push_back(newNode(7));    (root->child[2]->child).push_back(newNode(8));    (root->child[3]->child).push_back(newNode(9));    (root->child[3]->child).push_back(newNode(10));    (root->child[3]->child).push_back(newNode(11));    int N = 11;    int K = 5;    adj.resize(N + 1, vector());      DFS(root);    levelOrderTrav(5, 11);      return 0;}