Big Data - Machine Learning, Algorithms and Data Structures

little strokes fell great oaks.

Saturday, February 23, 2019

LeetCode 101. Symmetric Tree.java



For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
    1
   / \
  2   2
 / \ / \
3  4 4  3
But the following [1,2,2,null,3,null,3] is not:
    1
   / \
  2   2
   \   \
   3    3
Note:
Bonus points if you could solve it both recursively and iteratively.












Posted by bigdataoliver at 6:02 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: LeetCode, Recursion

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

bigdataoliver
View my complete profile

Blog Archive

  • ►  2021 (59)
    • ►  August (5)
    • ►  July (44)
    • ►  June (10)
  • ▼  2019 (15)
    • ▼  February (11)
      • LeetCode 98. Validate Binary Search Tree
      • LeetCode 200. Number of Islands.java
      • LeetCode 872. Leaf-Similar Trees.java
      • LeetCode 559. Maximum Depth of N-ary Tree.java
      • LeetCode 897. Increasing Order Search Tree.java
      • LeetCode 101. Symmetric Tree.java
      • LeetCode 104. Maximum Depth of Binary Tree
      • LeetCode 339. Nested List Weight Sum
      • LeetCode Weekly 124 - 995. Minimum Number of K Con...
      • LeetCode Weekly 124 - 994. Rotting Oranges
      • LeetCode Weekly 124 - 993. Cousins in Binary Tree
    • ►  January (4)
  • ►  2018 (40)
    • ►  May (1)
    • ►  April (2)
    • ►  March (6)
    • ►  February (12)
    • ►  January (19)
  • ►  2016 (3)
    • ►  September (3)
Picture Window theme. Powered by Blogger.