- 博客(26)
- 资源 (7)
- 收藏
- 关注
原创 LeetCode(55) Merge Intervals
题目如下:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].分析如下:一堆乱数无法merge, 很自然地想到要对intervals做排序,
2014-12-31 15:51:14 1118
原创 LeetCode(85) Maximal Rectangle
题目如下:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.分析如下:如果把这道题目的解答建立在上一道题目 Largest Rectangle in Histogram的基础上,就很容易解决了
2014-12-31 13:12:32 2105
原创 LeetCode(41) First Missing Positive
题目如下:A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks,
2014-12-31 08:08:19 3619
原创 LeetCode(160) Intersection of Two Linked Lists
题目如下:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘
2014-12-30 16:58:50 1236
原创 LeetCode(99) Recover Binary Search Tree
题目如下:Two 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 yo
2014-12-30 15:56:30 1095
原创 LeetCode(82) Largest Rectangle in Histogram
题目如下:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogra
2014-12-30 07:14:25 1119
原创 LeetCode(150) Evaluate Reverse Polish Notation
题目如下:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1
2014-12-24 17:51:02 785
原创 LeetCode(146) LRU Cache
题目如下:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the
2014-12-24 03:24:57 1600
原创 LeetCode(38) Count and Say
题目如下:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off
2014-12-23 15:19:41 937
原创 LeetCode(168) Excel Sheet Column Title
题目如下:Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 ->
2014-12-23 14:49:34 3974
原创 LeetCode(71) Simplify Path
题目如下:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:Did you c
2014-12-23 07:23:33 2130
原创 LeetCode(165) Version Number
题目如下:Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 You may assume that the version strings are non-empty and contain only digits and the . char
2014-12-23 03:46:19 667
原创 LeetCode(169) Majority Number
题目如下:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority ele
2014-12-22 10:39:23 2850
原创 LeetCode(130) Surrounded Regions
题目如下:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O X
2014-12-21 07:50:46 756
原创 LeetCode(97) Interleaving String
题目如下:Given 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",
2014-12-20 15:41:22 1029
原创 LeetCode(78) Word Search
题目如下:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or verti
2014-12-19 15:12:58 1222 2
原创 LeetCode(90) Decode Ways
题目如下:分析如下:首先题目典型的动态规划风格。用count[i]代表从string s的第0位到第i位的decode的方式, 用s(i, i+2)代表s的从i开始长度为2的sub string.假设 count[i+2] = 0,而count [i+1], count[i], count[i-1]...count[0]的值都已经算出来了,那么动态转换的方程式将是,if s(i,
2014-12-19 01:36:01 986
原创 LeetCode(40) Combination Sum II
题目如下:My Submissions Question Solution Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in
2014-12-18 16:27:48 1100
原创 LeetCode(39) Combination Sum
题目如下:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited n
2014-12-18 14:28:00 1000
原创 Leetcode(91) Restore IP Address
题目如下:Given 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"].
2014-12-17 15:03:11 1219
原创 Leetcode(132) Palindrome Partitioning II
题目如下:Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Ret
2014-12-17 03:47:14 1418
原创 LeetCode(131)Palindrome Partitioning
题目如下:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [
2014-12-16 14:37:21 1073
原创 fopen()中w 和w+的区别
测试代码#include #include int main(){ FILE *fp; fp = fopen("test.txt", "w");// fp = fopen("testt.txt", "w+"); fprintf(fp, "1This is testing for fprintf...\n"); fprintf(fp, "2This is test
2014-12-10 02:07:25 34809 1
原创 LeetCode(134)Gas Station
题目如下:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station
2014-12-05 09:24:33 1316
原创 LeetCode(124) Binary Tree Maximum Path Sum
题目如下:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.分
2014-12-02 16:55:49 1178
原创 LeetCode(128)Longest Consecutive Sequence
题目如下:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1,
2014-12-01 15:40:38 742
数据挖掘--概念.模型.方法和算法
2009-09-20
机器学习 Tom Mitchell 中文版
2009-09-20
机器学习英文版Machine Learning(Mitchell)(下)
2009-09-14
机器学习英文版Machine Learning(Mitchell)(中)
2009-09-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人