关闭
当前搜索:

leetcode: 100. Same Tree

QGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example 1:In...
阅读(164) 评论(0)

leetcode: 99. Recover Binary Search Tree

QTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note: A solution using O(n) space is pretty straight forward. Could you devise a cons...
阅读(162) 评论(0)

leetcode: 98. Validate Binary Search Tree

QGiven 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 node contains only nodes with keys less than the node’s key. The righ...
阅读(156) 评论(0)

leetcode: 97. Interleaving String

QGiven 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”, return true. When s3 = “aadbbbaccc”, return fals...
阅读(157) 评论(0)

leetcode: 96. Unique Binary Search Trees

QGiven 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 unique BST’s. 1 3 3 2 1 \ /...
阅读(139) 评论(0)

leetcode: 95. Unique Binary Search Trees II

QGiven an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example, Given n = 3, your program should return all 5 unique BST’s shown below. 1...
阅读(135) 评论(0)

leetcode: 94. Binary Tree Inorder Traversal

QGiven a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,3,2].Note: Recursive solution is trivial, cou...
阅读(130) 评论(0)

leetcode: 93. Restore IP Addresses

QGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example: Given “25525511135”,return [“255.255.11.135”, “255.255.111.35”]. (Order does not...
阅读(128) 评论(0)

leetcode: 92. Reverse Linked List II

QReverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note: Given m, n satisfy the following c...
阅读(122) 评论(0)

leetcode: 91. Decode Ways

QA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the total number of...
阅读(150) 评论(0)
101条 共11页1 2 3 4 5 ... 下一页 尾页
    Site Search
    Google 本站
    个人资料
    • 访问:88802次
    • 积分:4964
    • 等级:
    • 排名:第6068名
    • 原创:398篇
    • 转载:4篇
    • 译文:0篇
    • 评论:22条
    About
    博客专栏
    文章分类