Tag: depth-first-search
- Accounts Merge
- Add One Row to Tree
- Alien Dictionary
- All Ancestors of a Node in a Directed Acyclic Graph
- All Elements in Two Binary Search Trees
- All Nodes Distance K in Binary Tree
- All Paths From Source to Target
- Amount of Time for Binary Tree to Be Infected
- Apply Substitutions
- Array Nesting
- Average of Levels in Binary Tree
- Balance a Binary Search Tree
- Balanced Binary Tree
- Battleships in a Board
- Binary Search Tree to Greater Sum Tree
- Binary Tree Cameras
- Binary Tree Coloring Game
- Binary Tree Inorder Traversal
- Binary Tree Longest Consecutive Sequence II
- Binary Tree Longest Consecutive Sequence
- Binary Tree Maximum Path Sum
- Binary Tree Paths
- Binary Tree Postorder Traversal
- Binary Tree Preorder Traversal
- Binary Tree Pruning
- Binary Tree Right Side View
- Binary Tree Tilt
- Binary Tree Upside Down
- Binary Tree Vertical Order Traversal
- Boundary of Binary Tree
- Bulb Switcher II
- Change the Root of a Binary Tree
- Cheapest Flights Within K Stops
- Check for Contradictions in Equations
- Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
- Check if DFS Strings Are Palindromes
- Check if the Rectangle Corner Is Reachable
- Check if There is a Valid Path in a Grid
- Check If Two Expression Trees are Equivalent
- Check Knight Tour Configuration
- Choose Edges to Maximize Score in a Tree
- Clone Binary Tree With Random Pointer
- Clone Graph
- Clone N-ary Tree
- Closest Binary Search Tree Value II
- Closest Binary Search Tree Value
- Closest Leaf in a Binary Tree
- Closest Node to Path in Tree
- Closest Nodes Queries in a Binary Search Tree
- Coloring A Border
- Concatenated Words
- Construct Binary Tree from String
- Construct String from Binary Tree
- Contain Virus
- Convert Binary Search Tree to Sorted Doubly Linked List
- Convert BST to Greater Tree
- Correct a Binary Tree
- Count Good Nodes in Binary Tree
- Count Nodes Equal to Average of Subtree
- Count Nodes Equal to Sum of Descendants
- Count Nodes That Are Great Enough
- Count Nodes With the Highest Score
- Count Number of Possible Root Nodes
- Count Pairs of Connectable Servers in a Weighted Tree Network
- Count Paths That Can Form a Palindrome in a Tree
- Count Servers that Communicate
- Count Sub Islands
- Count the Number of Complete Components
- Count the Number of Good Nodes
- Count Univalue Subtrees
- Count Unreachable Pairs of Nodes in an Undirected Graph
- Count Valid Paths in a Tree
- Couples Holding Hands
- Course Schedule II
- Course Schedule IV
- Course Schedule
- Cousins in Binary Tree II
- Cousins in Binary Tree
- Cracking the Safe
- Create Components With Same Value
- Critical Connections in a Network
- Deepest Leaves Sum
- Delete Leaves With a Given Value
- Delete Nodes And Return Forest
- Delete Tree Nodes
- Design Add and Search Words Data Structure
- Design Search Autocomplete System
- Detect Cycles in 2D Grid
- Detonate the Maximum Bombs
- Diameter of Binary Tree
- Diameter of N-Ary Tree
- Difference Between Maximum and Minimum Price Sum
- Disconnect Path in a Binary Matrix by at Most One Flip
- Distance to a Cycle in Undirected Graph
- Distribute Coins in Binary Tree
- Divide Nodes Into the Maximum Number of Groups
- Employee Importance
- Encode N-ary Tree to Binary Tree
- Equal Tree Partition
- Escape a Large Maze
- Evaluate Boolean Binary Tree
- Evaluate Division
- Extract Kth Character From The Rope Tree
- Find a Corresponding Node of a Binary Tree in a Clone of That Tree
- Find All Groups of Farmland
- Find All People With Secret
- Find All The Lonely Nodes
- Find Bottom Left Tree Value
- Find Closest Node to Given Two Nodes
- Find Distance in a Binary Tree
- Find Duplicate Subtrees
- Find Edges in Shortest Paths
- Find Elements in a Contaminated Binary Tree
- Find Eventual Safe States
- Find if Path Exists in Graph
- Find Largest Value in Each Tree Row
- Find Leaves of Binary Tree
- Find Minimum Diameter After Merging Two Trees
- Find Mode in Binary Search Tree
- Find Number of Coins to Place in Tree Nodes
- Find Root of N-Ary Tree
- Find Subtree Sizes After Changes
- Find the Last Marked Nodes in Tree
- Find the Level of Tree with Minimum Sum
- Flatten a Multilevel Doubly Linked List
- Flatten Binary Tree to Linked List
- Flatten Nested List Iterator
- Flip Binary Tree To Match Preorder Traversal
- Flip Equivalent Binary Trees
- Flood Fill
- Flower Planting With No Adjacent
- Freedom Trail
- Frog Position After T Seconds
- Graph Valid Tree
- Height of Binary Tree After Subtree Removal Queries
- Height of Special Binary Tree
- House Robber III
- Implement Magic Dictionary
- Increasing Order Search Tree
- Inorder Successor in BST
- Insufficient Nodes in Root to Leaf Paths
- Invert Binary Tree
- Is Array a Preorder of Some Binary Tree
- Is Graph Bipartite?
- Island Perimeter
- Jump Game III
- K-th Largest Perfect Subtree Size in Binary Tree
- Keys and Rooms
- Kill Process
- Kth Ancestor of a Tree Node
- Kth Smallest Element in a BST
- Largest BST Subtree
- Last Day Where You Can Still Cross
- Leaf-Similar Trees
- Lexicographical Numbers
- Lexicographically Smallest String After Applying Operations
- Linked List in Binary Tree
- Longest Absolute File Path
- Longest Cycle in a Graph
- Longest Increasing Path in a Matrix
- Longest Path With Different Adjacent Characters
- Longest Special Path II
- Longest Special Path
- Longest Univalue Path
- Longest Word With All Prefixes
- Longest ZigZag Path in a Binary Tree
- Loud and Rich
- Lowest Common Ancestor of a Binary Search Tree
- Lowest Common Ancestor of a Binary Tree II
- Lowest Common Ancestor of a Binary Tree IV
- Lowest Common Ancestor of a Binary Tree
- Lowest Common Ancestor of Deepest Leaves
- Making A Large Island
- Max Area of Island
- Maximize Amount After Two Days of Conversions
- Maximize Sum of Weights after Edge Removals
- Maximize the Number of Target Nodes After Connecting Trees I
- Maximize the Number of Target Nodes After Connecting Trees II
- Maximum Average Subtree
- Maximum Depth of Binary Tree
- Maximum Depth of N-ary Tree
- Maximum Difference Between Node and Ancestor
- Maximum Employees to Be Invited to a Meeting
- Maximum Genetic Difference Query
- Maximum Level Sum of a Binary Tree
- Maximum Number of Accepted Invitations
- Maximum Number of Fish in a Grid
- Maximum Number of K-Divisible Components
- Maximum Points After Collecting Coins From All Nodes
- Maximum Product of Splitted Binary Tree
- Maximum Score After Applying Operations on a Tree
- Maximum Subtree of the Same Color
- Maximum Sum BST in Binary Tree
- Maximum Width of Binary Tree
- Maximum XOR of Two Non-Overlapping Subtrees
- Merge BSTs to Create Single BST
- Merge Two Binary Trees
- Minesweeper
- Mini Parser
- Minimize Hamming Distance After Swap Operations
- Minimize Malware Spread II
- Minimize Malware Spread
- Minimize the Maximum Edge Weight of Graph
- Minimize the Total Price of the Trips
- Minimum Absolute Difference in BST
- Minimum Depth of Binary Tree
- Minimum Distance Between BST Nodes
- Minimum Edge Reversals So Every Node Is Reachable
- Minimum Flips in Binary Tree to Get Result
- Minimum Fuel Cost to Report to the Capital
- Minimum Height Trees
- Minimum Number of Days to Disconnect Island
- Minimum Path Cost in a Hidden Grid
- Minimum Runes to Add to Cast Spell
- Minimum Score After Removals on a Tree
- Minimum Score of a Path Between Two Cities
- Minimum Time to Break Locks I
- Minimum Time to Break Locks II
- Minimum Time to Collect All Apples in a Tree
- Most Frequent Subtree Sum
- Most Profitable Path in a Tree
- Most Stones Removed with Same Row or Column
- Move Sub-Tree of N-Ary Tree
- N-ary Tree Postorder Traversal
- N-ary Tree Preorder Traversal
- Nested List Weight Sum II
- Nested List Weight Sum
- Network Delay Time
- Number of Closed Islands
- Number of Connected Components in an Undirected Graph
- Number of Distinct Islands II
- Number of Distinct Islands
- Number of Enclaves
- Number of Good Leaf Nodes Pairs
- Number of Increasing Paths in a Grid
- Number of Islands
- Number of Nodes in the Sub-Tree With the Same Label
- Number of Nodes With Value One
- Number of Operations to Make Network Connected
- Number of Provinces
- Operations on Tree
- Pacific Atlantic Water Flow
- Path Sum II
- Path Sum III
- Path Sum IV
- Path Sum
- Path With Maximum Minimum Value
- Path With Minimum Effort
- Populating Next Right Pointers in Each Node II
- Populating Next Right Pointers in Each Node
- Possible Bipartition
- Print Binary Tree
- Properties Graph
- Pseudo-Palindromic Paths in a Binary Tree
- Pyramid Transition Matrix
- Range Sum of BST
- Reachable Nodes With Restrictions
- Reconstruct Itinerary
- Recover a Tree From Preorder Traversal
- Recover Binary Search Tree
- Redundant Connection II
- Redundant Connection
- Regions Cut By Slashes
- Remove Methods From Project
- Remove Sub-Folders from the Filesystem
- Reorder Routes to Make All Paths Lead to the City Zero
- Restore the Array From Adjacent Pairs
- Reverse Odd Levels of Binary Tree
- Same Tree
- Second Minimum Node In a Binary Tree
- Sentence Similarity II
- Serialize and Deserialize Binary Tree
- Serialize and Deserialize BST
- Serialize and Deserialize N-ary Tree
- Shortest Bridge
- Shortest Path in a Hidden Grid
- Similar String Groups
- Smallest Common Region
- Smallest Missing Genetic Value in Each Subtree
- Smallest Rectangle Enclosing Black Pixels
- Smallest String Starting From Leaf
- Smallest String With Swaps
- Smallest Subtree with all the Deepest Nodes
- Sort Items by Groups Respecting Dependencies
- Step-By-Step Directions From a Binary Tree Node to Another
- Subtree of Another Tree
- Sum of Distances in Tree
- Sum of Left Leaves
- Sum of Nodes with Even-Valued Grandparent
- Sum of Remoteness of All Cells
- Sum of Root To Leaf Binary Numbers
- Sum Root to Leaf Numbers
- Surrounded Regions
- Swim in Rising Water
- Symmetric Tree
- The Maze II
- The Maze III
- The Maze
- Throne Inheritance
- Time Needed to Inform All Employees
- Time Taken to Mark All Nodes
- Tree Diameter
- Tree of Coprimes
- Trim a Binary Search Tree
- Two Sum BSTs
- Two Sum IV - Input is a BST
- Univalued Binary Tree
- Valid Arrangement of Pairs
- Validate Binary Search Tree
- Validate Binary Tree Nodes
- Vertical Order Traversal of a Binary Tree
- Water and Jug Problem
- Web Crawler Multithreaded
- Web Crawler
- Word Search