上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页

LeetCode-103-Binary Tree Zigzag Level Order Traversal

摘要: 算法描述: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next leve 阅读全文
posted @ 2019-02-03 06:24 无名路人甲 阅读(82) 评论(0) 推荐(0) 编辑

LeetCode-102-Binary Tree Level Order Traversal

摘要: 算法描述: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary t 阅读全文
posted @ 2019-02-03 06:07 无名路人甲 阅读(75) 评论(0) 推荐(0) 编辑

LeetCode-98-Validate Binary Search Tree

摘要: 算法描述: Given 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 contain 阅读全文
posted @ 2019-02-02 16:04 无名路人甲 阅读(99) 评论(0) 推荐(0) 编辑

LeetCode-96-Unique Binary Search Trees

摘要: 算法描述: Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: 解题思路:动态规划,f(n) = f(0)*f(n-1) + f(1)*f(n-2) 阅读全文
posted @ 2019-02-02 15:20 无名路人甲 阅读(106) 评论(0) 推荐(0) 编辑

LeetCode-95-Unique Binary Search Trees II

摘要: 算法描述: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: 解题思路:深度优先,递归求解。 阅读全文
posted @ 2019-02-02 15:02 无名路人甲 阅读(112) 评论(0) 推荐(0) 编辑

LeetCode-94-Binary Tree Inorder Traversal

摘要: 算法描述: Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it itera 阅读全文
posted @ 2019-02-02 14:30 无名路人甲 阅读(94) 评论(0) 推荐(0) 编辑

LeetCode-93-Restore IP Addresses

摘要: 算法描述: Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: 解题思路:题目要求所有可能的结果,首先想到回溯法。重点有 阅读全文
posted @ 2019-02-02 14:03 无名路人甲 阅读(92) 评论(0) 推荐(0) 编辑

LeetCode-92-Reverse Linked List II

摘要: 算法描述: Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: 解题思路:链表题,首先要画图。四个指针,头指针,前指针,临时指针。 阅读全文
posted @ 2019-02-02 12:59 无名路人甲 阅读(72) 评论(0) 推荐(0) 编辑

LeetCode-91-Decode Ways

摘要: 算法描述: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given a non-empty string containing only digits, 阅读全文
posted @ 2019-02-02 12:04 无名路人甲 阅读(71) 评论(0) 推荐(0) 编辑

LeetCode-90-Subset II

摘要: 算法描述: Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not 阅读全文
posted @ 2019-02-01 16:47 无名路人甲 阅读(84) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页