📄️ Guidelines
First of all you should remember that you can look at matrix/grid and trees just as a specilization of graphs. Tree is a connected acyclic undirected graph (connected == there is path between any pair of nodes, acyclic = no cycle in the graph, undirected = the direction of relation is not important e.g. child is connected to parent just like the parent is connected to the child in tree). For the BFS purposes matrix/grid can be looked as 4-directionally adjacent graph, any matrix cell is a node in graph and it's connected to the 4 cells above, below, left and right. So if you get a tree or matrix/grid shortest path or level traversal problem remember to think about them as graph and apply the BFS.
📄️ Average of Levels in Binary Tree
Given the root of a binary tree, return the average value of the nodes on each level in the form of an array.
📄️ Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
📄️ Binary Tree Level Order Traversal
Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).
📄️ Binary Tree Level Order Traversal II
Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).
📄️ Binary Tree Zigzag Level Order Traversal
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between).
📄️ Binary Tree Right Side View
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
📄️ Populating Next Right Pointers in Each Node
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children.
📄️ Populating Next Right Pointers in Each Node II
Given a binary tree. Populate each next pointer to point to its next right node.
📄️ 01 Matrix
Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.
📄️ Rotting Oranges
Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten.
📄️ Maximum Width of Binary Tree
Given the root of a binary tree, return the maximum width of the given tree.
📄️ Word Ladder
A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that...