自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(199)
  • 资源 (5)
  • 收藏
  • 关注

原创 leetcode 刷题之路 60 Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321对一个整数进行

2014-08-09 19:49:00 741 1

原创 leetcode 刷题之路 59 Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?

2014-08-09 19:42:27 495

原创 leetcode 刷题之路 58 Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?

2014-08-09 19:04:00 492

原创 leetcode 刷题之路 57 Subsets II

Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain dupli

2014-08-09 16:29:11 546

原创 leetcode 刷题之路 56 Subsets (非递归解法)

Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For exa

2014-08-09 15:51:46 1014

原创 leetcode 刷题之路 55 Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".二进制字符串xiang

2014-08-09 01:43:04 566

原创 leetcode 刷题之路 54 Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i

2014-08-09 01:23:35 505

原创 leetcode 刷题之路 53 Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]

2014-08-09 00:00:10 485

原创 leetcode 刷题之路 52 Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each

2014-08-08 18:33:15 584

原创 linux下实现生产者消费者问题

生产者(producer)和消费者(consumer)问题是并发处理中最常见的一类问题,是一个多线程同步问题的经典案例。可以这样描述这个问题,有一个或者多个生产者产生某种类型的数据,并放置在固定大小的缓冲区中,一个消费者从缓冲区中取数据,每次取一项,系统必须保证对缓冲区的重复操作,任何时候,只有一个生产者或者消费者可以访问缓冲区;同时,消费者只能在缓冲区不为空的时候从缓冲区中读数据,生产者只能在缓冲区不为满的时候向缓冲区写入数据。

2014-08-08 16:21:20 16214 2

原创 leetcode 刷题之路 51 Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]

2014-08-08 03:19:48 600

原创 leetcode 刷题之路 50 Unique Binary Search Trees II

Given 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 3

2014-08-07 22:26:06 484

原创 leetcode 刷题之路 49 Unique Binary Search Trees

Given 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 \

2014-08-07 19:35:31 452

原创 leetcode 刷题之路 48 Implement strStr()

Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.字符串

2014-08-07 16:20:54 455

原创 leetcode 刷题之路 47 Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.E

2014-08-07 11:43:56 435

原创 leetcode 刷题之路 46 Set Matrix Zeroes

Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A straight forward solution using

2014-08-06 19:57:13 522

原创 leetcode 刷题之路 45 Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe

2014-08-05 14:44:13 542

原创 leetcode 刷题之路 44 String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

2014-08-04 15:04:40 477

原创 leetcode 刷题之路 43 Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->

2014-08-04 13:58:41 630

原创 leetcode 刷题之路 42 Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va

2014-08-03 21:19:43 484

原创 备忘录模式

在玩游戏的时候,

2014-08-03 17:47:39 563

原创 命令模式

学校附近有一家

2014-08-03 16:07:41 555

原创 leetcode 刷题之路 41 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 [ ["aa","

2014-08-03 12:57:26 490

原创 leetcode 刷题之路 40 Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.求二叉树的最小深度,最小深度定义为从根节点do

2014-08-03 11:03:23 537

原创 leetcode 刷题之路 39 Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the

2014-08-03 00:54:07 513

原创 责任链模式

大家都在学校里呆了很多年,必然非常熟悉这样的情形,我们上课的时候想上厕所,直接向代课老师打报告,代课老师会直接同意,但是我们身体不适需要请假一两天的时候代课老师就没有这个权利,代课lao需要向班主任请假,这种事情班主任有权利直接批准,更甚至,如果我们中有像韩寒这样少年时就显露才华的人,想提出退学申请走文学道路的时候,班主任就会把申请提交给校长来权夺。这就是责任链模式的典型应用场景,它包含了一些

2014-08-02 00:48:48 524

原创 leetcode 刷题之路 38 Decode Ways

sdfclass Solution{public: int numDecodings(string s) { int len = s.length(); return helper(s, 0, len); } int helper(string &s, int cur, int len) { if (cur == len) return 1; if (

2014-08-01 17:53:53 476

原创 leetcode 刷题之路 37 Merge Sorted Array

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from

2014-08-01 16:02:38 496

原创 迭代器模式

迭代器(Iterator)模式在

2014-08-01 14:27:12 470

原创 leetcode 刷题之路 36 Pow(x, n)

Implement pow(x, n).求

2014-08-01 10:37:08 504

原创 leetcode 刷题之路 35 Search in Rotated Sorted Array II (旋转排序数组查找终极版)

Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in the

2014-08-01 09:46:13 535

原创 leetcode 刷题之路 34 Rotate Image

You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?

2014-08-01 00:34:11 640

原创 leetcode 刷题之路 33 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 vertically

2014-07-31 20:46:33 523

原创 模板方法模式

模板方法的定义为:

2014-07-31 19:56:35 468

原创 leetcode 刷题之路 32 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].

2014-07-30 21:00:07 485

原创 使用python自动备份博客

python版本:3.3.3

2014-07-30 16:21:25 618

原创 leetcode 刷题之路 31 Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [

2014-07-29 21:08:44 497

原创 leetcode 刷题之路 30 Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2014-07-29 11:45:24 485

原创 leetcode 刷题之路 29 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 contains only nodes with keys less than the node's key.Th

2014-07-29 00:14:43 456

原创 leetcode 刷题之路 28 Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.判断一个数字是否是回文数字。

2014-07-28 23:41:34 470

百面机器学习,纯净文字版

百面机器学习 文字版 面试必看 电子书只为方便使用 希望大家支持正版 配合纸质版一起使用

2018-12-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除