category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

Left view of the binary tree

Code ```cpp vector leftView(Node *root){ if (root == nullptr) return {}; vector ans; queue<Node*> qu; qu.push(root); while (!qu.empty()) { int Size = qu.size(); vector temp; for (int i = 0; i < Size; i++) { auto root = qu.front(); qu.pop(); temp.push_back(root -> data); if (root -> left) qu.push(root -> left); if (root -> right) qu.push(root -> right); } if (!temp.empty()) ans.push_back(temp.front()); } return ans; } ``` </details>