## 題目描述

`/*struct TreeNode {    int val;    struct TreeNode *left;    struct TreeNode *right;    TreeNode(int x) :            val(x), left(NULL), right(NULL) {    }};*//*struct ListNode {    int val;    struct ListNode *next;    ListNode(int x) : val(x), next(NULL) {}};*/class TreeLevel {public:    void Get(TreeNode *root, int dep, ListNode* &t){        if(dep == 1){            ListNode *tmp = new ListNode(root->val);             t->next = tmp;             t = tmp;         }else{            if(root->left){                Get(root->left, dep-1, t);             }            if(root->right){                Get(root->right, dep-1, t);             }        }    }        ListNode* getTreeLevel(TreeNode* root, int dep) {         if(dep <= 0 || root == NULL ){            return NULL;         }                ListNode *ans = new ListNode(-1);         ListNode *t = ans;         Get(root, dep, t);         return ans->next;                 // write code here          /*         if(root == NULL){            return NULL;         }        int tmp_int;         ListNode *ans;         ListNode *tt = ans;                 queue<TreeNode *> q;        queue<int> qint;                 q.push(root); qint.push(1);                 while(!q.empty()){            TreeNode *tmp = q.front(); q.pop();             int tmp_int = qint.front(); qint.pop();                         if(dep == tmp_int){                ListNode *t = new ListNode(tmp->val);                 tt->next = t;                 tt = t;             }            if(tmp->left){                q.push(tmp->left); qint.push(tmp_int + 1);             }            if(tmp->right){                q.push(tmp->right); qint.push(tmp_int + 1);             }        }          return ans->next; */      }};`