- What is Graph data structure?
A graph is a collection of nodes (vertices) and edges (connections) that represent pairwise relationships between nodes. Graphs are widely used to model various real-world systems, including social networks, transportation networks, computer networks, and more
- Path Sum
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 sum. A leaf is a node with no children.
- Path Sum II
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.
- Path Sum III
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 target sum. The paths can start and end at any node in the tree, but they must go in the downward direction.