题目链接:Binary Tree Zigzag Level Order TraversalGiven a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to ...
More »
题目链接:Binary Tree Level Order TraversalGiven a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:...
More »
题目链接:Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / ...
More »
题目链接:Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and t...
More »
题目链接:Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using ...
More »
题目链接:Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows: The left subtree of a nod...
More »
题目链接:Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = “aabcc”,s2 = “dbbca”,When s3 = “aadbbcbcac”...
More »
题目链接:Unique Binary Search TreesGiven n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example,Given n = 3, there are a total of 5 ...
More »
题目链接:Unique Binary Search Trees IIGiven n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example,Given n = 3, your program sho...
More »
题目链接:Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes’ values.For example:Given binary tree {1,#,2,3}, 1 \ 2 ...
More »