πŸ“
notes
  • Initial page
  • 02_ds_algo
    • ds
      • Union Find
      • Binary Indexed Tree
      • Stack
      • String
      • Linked List
      • Segment Tree
      • Union Find
      • Union Find
      • Array
      • Tree
      • Hash Table
      • queue
    • algo
      • Backtracking
      • Sort
      • Binary Search
      • Depth First Search
      • Bit Manipulation
      • Dynamic Programming
      • Breadth First Search
      • Two Pointers
      • Math
      • Sliding Window
    • leetcode
      • List
      • 1. Two Sum
      • READEME
      • 2. Add Two Numbers
  • README
    • README
      • pointer
      • effective-cpp
      • roadmap
      • pimpl
      • smartptr
  • 03_cheatsheet
    • README
      • git
      • gdb
    • README
      • bash
      • Python ι€ŸζŸ₯θ‘¨δΈ­ζ–‡η‰ˆ
    • README
      • vim
Powered by GitBook
On this page

Was this helpful?

  1. 02_ds_algo
  2. ds

Tree

No.

Title

Solution

Difficulty

TimeComplexity

SpaceComplexity

Favorite

Acceptance

0094

Binary Tree Inorder Traversal

Medium

O(n)

O(1)

65.5%

0095

Unique Binary Search Trees II

Medium

42.2%

0096

Unique Binary Search Trees

Medium

O(n^2)

O(n)

54.2%

0098

Validate Binary Search Tree

Medium

O(n)

O(1)

28.6%

0099

Recover Binary Search Tree

Hard

O(n)

O(1)

42.2%

0100

Same Tree

Easy

O(n)

O(1)

54.0%

0101

Symmetric Tree

Easy

O(n)

O(1)

47.9%

0102

Binary Tree Level Order Traversal

Medium

O(n)

O(1)

56.3%

0103

Binary Tree Zigzag Level Order Traversal

Medium

O(n)

O(n)

49.8%

0104

Maximum Depth of Binary Tree

Easy

O(n)

O(1)

67.8%

0105

Construct Binary Tree from Preorder and Inorder Traversal

Medium

51.4%

0106

Construct Binary Tree from Inorder and Postorder Traversal

Medium

49.3%

0107

Binary Tree Level Order Traversal II

Easy

O(n)

O(1)

54.9%

0108

Convert Sorted Array to Binary Search Tree

Easy

O(n)

O(1)

60.1%

0110

Balanced Binary Tree

Easy

O(n)

O(1)

44.6%

0111

Minimum Depth of Binary Tree

Easy

O(n)

O(1)

39.3%

0112

Path Sum

Easy

O(n)

O(1)

42.2%

0113

Path Sum II

Medium

O(n)

O(1)

48.7%

0114

Flatten Binary Tree to Linked List

Medium

O(n)

O(1)

51.5%

0124

Binary Tree Maximum Path Sum

Hard

O(n)

O(1)

35.3%

0129

Sum Root to Leaf Numbers

Medium

O(n)

O(1)

50.6%

0144

Binary Tree Preorder Traversal

Medium

O(n)

O(1)

57.2%

0145

Binary Tree Postorder Traversal

Medium

O(n)

57.2%

0173

Binary Search Tree Iterator

Medium

O(n)

O(1)

59.7%

0199

Binary Tree Right Side View

Medium

O(n)

O(1)

55.8%

0222

Count Complete Tree Nodes

Medium

O(n)

O(1)

48.9%

0226

Invert Binary Tree

Easy

O(n)

O(1)

66.7%

0230

Kth Smallest Element in a BST

Medium

O(n)

O(1)

62.2%

0235

Lowest Common Ancestor of a Binary Search Tree

Easy

O(n)

O(1)

51.5%

0236

Lowest Common Ancestor of a Binary Tree

Medium

O(n)

O(1)

48.2%

0257

Binary Tree Paths

Easy

O(n)

O(1)

53.3%

0337

House Robber III

Medium

51.7%

0404

Sum of Left Leaves

Easy

O(n)

O(1)

52.2%

0437

Path Sum III

Medium

O(n)

O(1)

48.0%

0508

Most Frequent Subtree Sum

Medium

58.9%

0513

Find Bottom Left Tree Value

Medium

62.4%

0515

Find Largest Value in Each Tree Row

Medium

O(n)

O(n)

62.1%

0563

Binary Tree Tilt

Easy

52.7%

0572

Subtree of Another Tree

Easy

44.5%

0637

Average of Levels in Binary Tree

Easy

O(n)

O(n)

64.6%

0653

Two Sum IV - Input is a BST

Easy

56.2%

0662

Maximum Width of Binary Tree

Medium

40.0%

0684

Redundant Connection

Medium

58.8%

0685

Redundant Connection II

Hard

32.9%

0834

Sum of Distances in Tree

Hard

45.6%

0863

All Nodes Distance K in Binary Tree

Medium

57.6%

0872

Leaf-Similar Trees

Easy

64.6%

0897

Increasing Order Search Tree

Easy

74.4%

0968

Binary Tree Cameras

Hard

38.5%

0979

Distribute Coins in Binary Tree

Medium

69.5%

0993

Cousins in Binary Tree

Easy

O(n)

O(1)

52.3%

1026

Maximum Difference Between Node and Ancestor

Medium

69.2%

1028

Recover a Tree From Preorder Traversal

Hard

70.8%

1110

Delete Nodes And Return Forest

Medium

67.6%

1123

Lowest Common Ancestor of Deepest Leaves

Medium

67.9%

1145

Binary Tree Coloring Game

Medium

51.4%

1302

Deepest Leaves Sum

Medium

84.1%

1305

All Elements in Two Binary Search Trees

Medium

77.8%

------------

-------------------------------------------------------

-------

----------------

---------------

-------------

-------------

-------------

PreviousArrayNextHash Table

Last updated 4 years ago

Was this helpful?