Explore the solution

Log in or sign up to explore the explanation and learn how to solve this problem.

Log in / Sign up
0
/**
* Definition for a binary tree node.
* struct TreeNode {
* int data;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int val) : data(val) , left(nullptr) , right(nullptr) {}
* };
**/
 
class Solution {
public:
vector<vector<int> > levelOrder(TreeNode* root) {
//your code goes here
}
};
Test Case

Input:

Root