PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
HomeLeetCode ProblemsTree

Tree Problems

191 Tree LeetCode problems · Solve with AI-powered hints & step-by-step explanations.

94Binary Tree Inorder TraversalEasy95Unique Binary Search Trees IIMedium96Unique Binary Search TreesMedium98Validate Binary Search TreeMedium99Recover Binary Search TreeMedium100Same TreeEasy101Symmetric TreeEasy102Binary Tree Level Order TraversalMedium103Binary Tree Zigzag Level Order TraversalMedium104Maximum Depth of Binary TreeEasy105Construct Binary Tree from Preorder and Inorder TraversalMedium106Construct Binary Tree from Inorder and Postorder TraversalMedium107Binary Tree Level Order Traversal IIMedium108Convert Sorted Array to Binary Search TreeEasy109Convert Sorted List to Binary Search TreeMedium110Balanced Binary TreeEasy111Minimum Depth of Binary TreeEasy112Path SumEasy113Path Sum IIMedium114Flatten Binary Tree to Linked ListMedium116Populating Next Right Pointers in Each NodeMedium117Populating Next Right Pointers in Each Node IIMedium124Binary Tree Maximum Path SumHard129Sum Root to Leaf NumbersMedium144Binary Tree Preorder TraversalEasy145Binary Tree Postorder TraversalEasy173Binary Search Tree IteratorMedium199Binary Tree Right Side ViewMedium222Count Complete Tree NodesEasy226Invert Binary TreeEasy230Kth Smallest Element in a BSTMedium235Lowest Common Ancestor of a Binary Search TreeMedium236Lowest Common Ancestor of a Binary TreeMedium257Binary Tree PathsEasy297Serialize and Deserialize Binary TreeHard331Verify Preorder Serialization of a Binary TreeMedium337House Robber IIIMedium341Flatten Nested List IteratorMedium404Sum of Left LeavesEasy427Construct Quad TreeMedium429N-ary Tree Level Order TraversalMedium437Path Sum IIIMedium449Serialize and Deserialize BSTMedium450Delete Node in a BSTMedium501Find Mode in Binary Search TreeEasy508Most Frequent Subtree SumMedium513Find Bottom Left Tree ValueMedium515Find Largest Value in Each Tree RowMedium530Minimum Absolute Difference in BSTEasy538Convert BST to Greater TreeMedium543Diameter of Binary TreeEasy558Logical OR of Two Binary Grids Represented as Quad-TreesMedium559Maximum Depth of N-ary TreeEasy563Binary Tree TiltEasy572Subtree of Another TreeEasy589N-ary Tree Preorder TraversalEasy590N-ary Tree Postorder TraversalEasy606Construct String from Binary TreeMedium617Merge Two Binary TreesEasy623Add One Row to TreeMedium637Average of Levels in Binary TreeEasy652Find Duplicate SubtreesMedium653Two Sum IV - Input is a BSTEasy654Maximum Binary TreeMedium655Print Binary TreeMedium662Maximum Width of Binary TreeMedium669Trim a Binary Search TreeMedium671Second Minimum Node In a Binary TreeEasy687Longest Univalue PathMedium690Employee ImportanceMedium700Search in a Binary Search TreeEasy701Insert into a Binary Search TreeMedium703Kth Largest Element in a StreamEasy783Minimum Distance Between BST NodesEasy814Binary Tree PruningMedium834Sum of Distances in TreeHard863All Nodes Distance K in Binary TreeMedium865Smallest Subtree with all the Deepest NodesMedium872Leaf-Similar TreesEasy889Construct Binary Tree from Preorder and Postorder TraversalMedium894All Possible Full Binary TreesMedium897Increasing Order Search TreeEasy919Complete Binary Tree InserterMedium938Range Sum of BSTEasy951Flip Equivalent Binary TreesMedium958Check Completeness of a Binary TreeMedium965Univalued Binary TreeEasy968Binary Tree CamerasHard971Flip Binary Tree To Match Preorder TraversalMedium979Distribute Coins in Binary TreeMedium987Vertical Order Traversal of a Binary TreeHard988Smallest String Starting From LeafMedium993Cousins in Binary TreeEasy998Maximum Binary Tree IIMedium1008Construct Binary Search Tree from Preorder TraversalMedium1022Sum of Root To Leaf Binary NumbersEasy1026Maximum Difference Between Node and AncestorMedium1028Recover a Tree From Preorder TraversalHard1038Binary Search Tree to Greater Sum TreeMedium1080Insufficient Nodes in Root to Leaf PathsMedium1104Path In Zigzag Labelled Binary TreeMedium1110Delete Nodes And Return ForestMedium1123Lowest Common Ancestor of Deepest LeavesMedium1145Binary Tree Coloring GameMedium1161Maximum Level Sum of a Binary TreeMedium1261Find Elements in a Contaminated Binary TreeMedium1302Deepest Leaves SumMedium1305All Elements in Two Binary Search TreesMedium1315Sum of Nodes with Even-Valued GrandparentMedium1325Delete Leaves With a Given ValueMedium1339Maximum Product of Splitted Binary TreeMedium1361Validate Binary Tree NodesMedium1367Linked List in Binary TreeMedium1372Longest ZigZag Path in a Binary TreeMedium1373Maximum Sum BST in Binary TreeHard1376Time Needed to Inform All EmployeesMedium1377Frog Position After T SecondsHard1379Find a Corresponding Node of a Binary Tree in a Clone of That TreeEasy1382Balance a Binary Search TreeMedium1443Minimum Time to Collect All Apples in a TreeMedium1448Count Good Nodes in Binary TreeMedium1457Pseudo-Palindromic Paths in a Binary TreeMedium1483Kth Ancestor of a Tree NodeHard1519Number of Nodes in the Sub-Tree With the Same LabelMedium1530Number of Good Leaf Nodes PairsMedium1569Number of Ways to Reorder Array to Get Same BSTHard1600Throne InheritanceMedium1609Even Odd TreeMedium1617Count Subtrees With Max Distance Between CitiesHard1719Number Of Ways To Reconstruct A TreeHard1766Tree of CoprimesHard1916Count Ways to Build Rooms in an Ant ColonyHard1932Merge BSTs to Create Single BSTHard1993Operations on TreeMedium2003Smallest Missing Genetic Value in Each SubtreeHard2049Count Nodes With the Highest ScoreMedium2096Step-By-Step Directions From a Binary Tree Node to AnotherMedium2196Create Binary Tree From DescriptionsMedium2236Root Equals Sum of ChildrenEasy2246Longest Path With Different Adjacent CharactersHard2265Count Nodes Equal to Average of SubtreeMedium2322Minimum Score After Removals on a TreeHard2331Evaluate Boolean Binary TreeEasy2368Reachable Nodes With RestrictionsMedium2385Amount of Time for Binary Tree to Be InfectedMedium2415Reverse Odd Levels of Binary TreeMedium2421Number of Good PathsHard2440Create Components With Same ValueHard2458Height of Binary Tree After Subtree Removal QueriesHard2467Most Profitable Path in a TreeMedium2471Minimum Number of Operations to Sort a Binary Tree by LevelMedium2476Closest Nodes Queries in a Binary Search TreeMedium2477Minimum Fuel Cost to Report to the CapitalMedium2509Cycle Length Queries in a TreeHard2538Difference Between Maximum and Minimum Price SumHard2581Count Number of Possible Root NodesHard2583Kth Largest Sum in a Binary TreeMedium2603Collect Coins in a TreeHard2641Cousins in Binary Tree IIMedium2646Minimize the Total Price of the TripsHard2673Make Costs of Paths Equal in a Binary TreeMedium2791Count Paths That Can Form a Palindrome in a TreeHard2846Minimum Edge Weight Equilibrium Queries in a TreeHard2867Count Valid Paths in a TreeHard2872Maximum Number of K-Divisible ComponentsHard2920Maximum Points After Collecting Coins From All NodesHard2925Maximum Score After Applying Operations on a TreeMedium2973Find Number of Coins to Place in Tree NodesHard3067Count Pairs of Connectable Servers in a Weighted Tree NetworkMedium3068Find the Maximum Sum of Node ValuesHard3203Find Minimum Diameter After Merging Two TreesHard3241Time Taken to Mark All NodesHard3249Count the Number of Good NodesMedium3319K-th Largest Perfect Subtree Size in Binary TreeMedium3327Check if DFS Strings Are PalindromesHard3331Find Subtree Sizes After ChangesMedium3367Maximize Sum of Weights after Edge RemovalsHard3372Maximize the Number of Target Nodes After Connecting Trees IMedium3373Maximize the Number of Target Nodes After Connecting Trees IIHard3425Longest Special PathHard3486Longest Special Path IIHard3515Shortest Path in a Weighted TreeHard3544Subtree Inversion SumHard3553Minimum Weighted Subgraph With the Required Paths IIHard3558Number of Ways to Assign Edge Weights IMedium3559Number of Ways to Assign Edge Weights IIHard3562Maximum Profit from Trading Stocks with DiscountsHard3575Maximum Good Subtree ScoreHard3585Find Weighted Median Node in TreeHard3590Kth Smallest Path XOR SumHard3593Minimum Increments to Equalize Leaf PathsMedium
← Browse all LeetCode problems
PhantomCodeAIPhantomCodeAI
PhantomCodeAI is an undetectable desktop application to help you pass your Leetcode interviews.
All systems online
Download

Legal

Refund PolicyTerms of ServiceCancellation PolicyPrivacy Policy

Pages

Contact SupportHelp CenterInstant SupportFAQBlogFeaturesInterview CopilotCoding CopilotInterview QuestionsPricingMock Interview PricingEarn with UsBest AI Interview Assistants 2026FeedbackLeetcode ProblemsLoginCreate Account

Compare

All 29 comparisons →Why switch (29 alternatives) →Interview Coder AlternativeFinal Round AI AlternativeUltraCode AI AlternativeParakeet AI AlternativeAI Apply AlternativeCoderRank AlternativeInterviewing.io AlternativeShadeCoder Alternative

Resources

Salary GuideResume TemplatesWhat Is PhantomCodeAIIs PhantomCodeAI Detectable?Use PhantomCodeAI in HackerRankvs LeetCode PremiumFor European EngineersFor FAANG Interview PrepPost-Layoff ComebackIndia Pricing (INR)

Interview Types

Coding InterviewSystem Design InterviewDSA InterviewLeetCode InterviewAlgorithms InterviewData Structure InterviewSQL InterviewOnline Assessment

Interview Questions

See all →
GoogleAmazonMetaMicrosoftAppleNetflixStripeUberAirbnbBloombergSoftware EngineerFrontend EngineerBackend EngineerData EngineerML EngineerDevOps EngineerData ScientistEngineering ManagerBehavioralSystem Design

Mock Interview by Round Type

All formats →
Mock Interview HubMock Coding InterviewMock Behavioral InterviewMock System Design

AI for Industry Interviews

All industries →
Sales InterviewsPM InterviewsFinance InterviewsConsulting InterviewsDesign Interviews

Coding Interview Patterns

See all patterns →
Coding Interviews HubDynamic ProgrammingTwo Pointers + Sliding WindowGraph AlgorithmsTree AlgorithmsBinary Search

Interview Guides

See all guides →
How to Ace an InterviewHow to Crack InterviewsBest Interview AnswersScreening Interview QuestionsTelephone Interview TipsWorking Interview ExplainedCracking the PM InterviewFAANG 30-Day RoadmapTop 10 LeetCode PatternsSystem Design Prep GuideSTAR Behavioral MethodBehavioral Interview Qs

Alternatives — why engineers switch

See all 29 →
Interview CoderFinal Round AIParakeet AILockedIn AIUltraCode AIShadeCoderSensei AIVerve AICluelyChatGPTBeyz AIInterview SidekickYoodliAlgoMonsterCoderRankExponentFormationInterviewing.ioInterview CakeBig InterviewInterview KickstartPrampScalerAI ApplyCareerflowJobscanKickresumeTeal HQHireVue

AI Interview Tools

AI Interview AssistantAI Interview CoachAI for Job InterviewsAI Interview Preparation ToolReal-Time AI Interview AnswersInterview AI HelperReal-Time AI Interview AssistantAI Interview BotBest AI Interview Tools 2026AI Interview QuestionsPractice Interview QuestionsAI to Answer Interview QuestionsAI Phone Interview HelpAI Interviewing SoftwareAI Interview HubInterview CopilotAI Coding Interview AssistantMock Interview

© 2026 PhantomCodeAI. All rights reserved.