1.3) Binary Tree Zigzag Level Order Traversal
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. Zigzag level order traversal means visiting all nodes at each level alternatively from…
Master C, C++, Data Structures, Algorithms, Design Patterns, and More!
Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. Zigzag level order traversal means visiting all nodes at each level alternatively from…
Given the root of a binary tree, return the level order traversal of its nodes' values. Level order traversal means visiting all nodes at each level from left to right…
Given the root of a binary tree, return the inorder traversal of its nodes' values. In inorder traversal, we visit the left subtree first, then the current node, and finally…
Given the root of a binary search tree (BST), and integers low and high, find the sum of all node values in the BST that are within the range .
Given a binary tree, where each node has a value between 0 and 9, find the total sum of all root-to-leaf numbers. A root-to-leaf number is a number represented by…
Given a binary tree, find the maximum path sum. The maximum path sum is defined as the maximum sum of any path from any node to any node in the…
Given a binary tree and a target sum, find the total number of all paths in the tree such that the sum of the values along the path equals the…
Given a binary tree and a target sum, find all root-to-leaf paths where each path's sum equals the given target sum. A leaf is a node with no children.
Given a binary tree and a target sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given target…
Given a singly-linked list, find the middle node of the list. If the list contains an even number of nodes, return the second middle node.