自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

原创 Leetcode:335. Self Crossing

You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south, x[3] metres to the east and so on. I

2016-05-20 21:12:05 243

原创 进程间通信--信号量

进程间通信系列: 进程间通信--信号 前次我们已经讲过了在进程中信号来进行进程间的一些简单通信 如果是多线程的情景下呢我门如何保证多线程情景下的一个同步问题呢? 下开始接触信号量的应用什么是信号量为了防止出现因多个程序同时访问一个共享资源而引发的一系列问题,我们需要一种方法,它可以通过生成并使用令牌来授权,在任一时刻只能有一个执行线程访问代码的临界区域。临界区域是指执行数据更新的代码需要独占

2016-05-19 01:32:02 315

原创 进程间通信--信号

什么是信号用过Windows的我们都知道,当我们无法正常结束一个程序时,可以用任务管理器强制结束这个进程,但这其实是怎么实现的呢?同样的功能在Linux上是通过生成信号和捕获信号来实现的,运行中的进程捕获到这个信号然后作出一定的操作并最终被终止。 信号是UNIX和Linux系统响应某些条件而产生的一个事件,接收到该信号的进程会相应地采取一些行动。通常信号是由一个错误产生的。但它们还可以作为进程间通

2016-05-17 22:48:15 310

原创 Leetcode:72. Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:a) In

2016-05-15 01:15:19 285

原创 Leetcode:87. Scramble String

Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr eat

2016-05-14 18:56:51 219

原创 Leetcode:97. Interleaving String

Total Accepted: 48816 Total Submissions: 217231 Difficulty: HardGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aa

2016-05-01 13:02:40 227

原创 Leetcode:96. 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 \ /

2016-05-01 12:54:23 193

原创 Leetcode:91. Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number of w

2016-05-01 12:37:48 178

原创 Leetcode:85. Maximal Rectangle

Difficulty: Hard Ac 44msGiven a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and return its area.这道题一开始并没有什么好的思路,只能先截取每行为底,对每列求高,简化成一列数组球最大面积的问题,这样的复杂度大概是o(

2016-05-01 12:28:33 286

原创 Leetcode: 70. Climbing Stairs

you are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?读一遍题如果没发现是斐波拉切数列基本可疑抹脖子了 使用递归计算,给的N比

2016-05-01 12:05:22 287

原创 Leetcode:64. Minimum Path Sum

AC 10msGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right

2016-05-01 10:53:55 206

原创 Leetcode:63. Unique Paths II

Total Accepted: 65084 Total Submissions: 221586 Difficulty: Medium time o(n*m) space o(n*m) Ac 0msFollow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique

2016-05-01 10:44:12 220

原创 Leetcode:62. Unique Paths

Total Accepted: 86496 Total Submissions: 238592 Difficulty: Mediumtime O(n*m) space o(n*m) AC 0msA robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The r

2016-05-01 10:38:09 182

原创 Leetcode:53. Maximum Subarray

AC 4ms Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1]

2016-05-01 10:14:35 208

原创 Leetcode:44. Wildcard Matching

Implement wildcard pattern matching with support for ‘?’ and ‘*’.‘?’ Matches any single character. ‘*’ Matches any sequence of characters (including the empty sequence).The matching should cover the e

2016-05-01 10:00:36 192

原创 Mac/Linux --管理与维护

获取系统信息Top 获取CPU信息/Mem/disk等信息实时读取 - 网络arp 地址解析协议相关的netstat 查看网络状态处理操作grep 正则匹配过滤行awk 将相应行存入变量中未完待续~~~

2016-04-09 23:32:43 408

原创 Leetcode:3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. For “

2016-04-04 23:33:13 236

原创 Leetcode:2. Add Two Numbers

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example, Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5

2016-04-04 00:53:45 210

原创 Leetcode:1. Two Sum

温故而知新(再不总结就忘了)Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums

2016-04-04 00:15:03 239

原创 SQL:遇到的各种挠头的关系

腾讯编程题--当前表中数目大于2的行,再根据amont排列 orderid customerid amont date 1 3 69.98 2007-04-02 2 1 49.99 2007-04-15 3 2 74.98 2007-04-19 4 3 24.99 2007-05-01 5 1 34.53

2016-04-03 23:53:33 248

原创 Linux填坑系列之--grub引导修复

Ubuntu+WIN10双系统时,由于重新安装Win10的时候损坏了Ubuntu的引导系统而导致无法进入Ubuntu的情况其实很简单只需要找一个新的Ubuntu系统,将对应的引导文件copy到ubuntu所在的系统盘内. 刻录新的ubuntu系统文件到u盘,U盘启动系统,后选择适用ubuntu打开终端后输入如下代码,最好先输入sudo -i 切换到root用户,避免每次都用sudo 命令

2015-12-22 00:35:47 690

原创 浅入浅出--正则表达式

正则表达式为了打字方便我们称它为 –Regex 对长文本的处理是件很麻烦的是,我接触Regex是由于做爬虫的时候要处理很多HTML的tag,根据标签里的内容得到资源信息是件很麻烦的事情,但是有了正则后一切变得简单许多。Python 的正则引擎 –RE 首先,当我们遇到一大段字符串String,我们想要怎么处理它呢?也许我们想要拿它和已知的 pattern 对比,我们可以用到 Re.ma

2015-10-15 15:47:43 521

空空如也

空空如也

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

TA关注的人

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