自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Leetcode -- Single Number

Single Number I: Given an array of integers, every element appears twice except for one. Find that single one.分析: 异或操作,一遍过。代码:class Solution {public: int singleNumber(vector<int>& nums) {

2015-09-04 13:41:14 355

转载 【转载】[CSS] CSS position 觀念筆記心得

转载地址:http://blog.rx836.tw/blog/css-positioning/ css position 對於初學者來說觀念很容易混淆,我在剛學習時也很常搞不清楚relative和absolute之間的關係,但只要抓到幾個訣竅重點,其實可以很輕鬆的掌握它,這篇是紀錄我自己學習css position的心得,搭配幾個簡單易懂的範例,讓大家一起成長Start 首先,css posit

2015-09-02 00:15:04 361

原创 Leetcode -- Maximum Subarray

题目: 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]

2015-09-01 21:46:24 347

原创 Leetcode -- Bitwise AND of Numbers Range

题目: Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. Credits: Special

2015-09-01 21:16:23 301

原创 Leetcode -- Minimum Path Sum

题目: Given 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

2015-08-29 23:03:38 302

原创 Leetcode -- Word Search(Important!)

题目: 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 vertical

2015-08-27 20:38:39 296

原创 Leetcode -- 4Sum

题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Elements in

2015-08-25 12:00:05 288

原创 Leetcode -- 3Sum Closest

题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exa

2015-08-25 11:52:36 297

原创 Leetcode -- 3Sum

题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c) mu

2015-08-25 11:46:18 377

原创 Leetcode -- 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, w

2015-08-25 11:38:25 300

原创 Leetcode -- Missing Number

题目: Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] return 2. Note: Your algorithm should ru

2015-08-24 18:53:24 329

原创 Leetcode -- Add Binary

题目: Given two binary strings, return their sum (also a binary string). For example, a = “11” b = “1” Return “100”.、分析: 就是这么简单,二进制相加代码:string addBinary(string a, string b) { string str = "

2015-08-23 19:54:16 354

原创 Leetcode -- Valid Sudoku

题目: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’ A partially filled sud

2015-08-23 18:01:14 286

原创 Leetcede -- Remove Duplicates from Sorted Array

题目: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place wi

2015-08-23 15:01:55 270

原创 Leetcode -- Count Primes

题目: Description: Count the number of prime numbers less than a non-negative number, n. Credits: Special thanks to @mithmatt for adding this problem and creating all test cases.分析【引自:Leetcode Hint】:

2015-08-20 13:27:08 354

原创 Sublime Text3 -- 好用的插件

Sublime text3 ,package control的安装,以及一些好用的插件。eg:Prerry Json, Jsonlint.

2015-08-19 12:01:43 528

原创 Leetcode -- Ugly Number II

题目: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first

2015-08-19 11:31:21 312

原创 Leetcode -- Convert Sorted List to Binary Search Tree

题目: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.分析: 将排好序的链表,转为平衡二叉搜索树。思路: 链表的中间那个node是树的根节点,前面是左子树,后面是右子树。以此,不断递归就可以得到平衡二叉树。时间复杂度是O(N

2015-08-17 15:38:23 362

原创 Install Gephi in Ubuntu 12.04

Install gephi in Ubuntu 12.04

2015-08-17 11:08:06 1720

原创 Leetcode -- Insertion Sort List

题目: Sort a linked list using insertion sort.分析: 插入排序。代码1:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NU

2015-08-16 21:19:08 324

原创 Leetcode -- Partition List

题目: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each

2015-08-16 17:51:04 262

原创 Leetcode -- 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->

2015-08-16 16:48:45 306

原创 Leetcode -- Reorder List

题目: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes’ values. For example, Given {1,2,3,4}, reorder it to

2015-08-15 20:30:34 299

原创 Leetcode -- Reorder List

题目: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes’ values. For example, Given {1,2,3,4}, reorder it to

2015-08-15 18:21:21 472

原创 Leetcode -- Reverse Linked List II

题目: Reverse 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 f

2015-08-15 10:17:18 296

原创 Leetcode -- Rotate List

题目: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL.分析: 将后面的k个node旋转到链表的开头。若k大于链表的长度,则

2015-08-15 09:40:45 323

原创 Leetcode -- Sort List

题目: Sort a linked list in O(n log n) time using constant space complexity.分析: O(n log n)有归并排序,快速排序和堆排序。针对链表,采用归并排序是比较合理的。快排在最坏的情况,复杂度是O(n^2)。思路:难点在于寻找链表的中点。代码: ListNode* sortList(ListNode* head) {

2015-08-14 18:55:08 540 1

原创 Leetcode -- Swap Nodes in Pairs

题目: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y

2015-08-14 17:25:16 289

原创 Leetcode -- Remove Duplicates from Sorted List

题目: Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3.分析: 在一个链表中,将重复val的node去掉

2015-08-14 16:59:30 238

原创 Leetcode -- Remove Linked List Elements

题目: Remove all elements from a linked list of integers that have value val. Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Return: 1 –> 2 –> 3 –> 4 –> 5分析: 删除链表中顶点值为val的node思路: 遍历链表,遇到满足

2015-08-14 16:35:27 442

转载 js event 属性

转载自:http://blog.163.com/duanpeng3@126/blog/static/88543735201053115035512/ [略有修改]event代表事件的状态,例如触发event对象的元素、鼠标的位置及状态、按下的键等等。 event对象只在事件发生的过程中才有效。 event的某些属性只对特定的事件有意义。比如,fromElement 和 toElement 属性

2015-08-14 15:58:14 444

原创 Leetcode -- 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, t

2015-08-14 12:26:19 357

原创 Leetcode:Merge Two Sorted Lists(Importance!)

题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.分析:将两个排好序的list弄一个排好序的list。基本思想,就是在不新建空间的情况下,改变指针的方向。代码:

2015-08-13 10:25:42 261

原创 Leetcode -- Longest Common Prefix

题目: Write a function to find the longest common prefix string amongst an array of strings.分析: 一堆string里面,找到大家共有的从头部开始的字串思路: 遍历,复杂度O(N)。每次记下当前最长的字串,然后跟新的一个string比较,获取当前的最长字串。代码:string longestCommonPr

2015-08-11 17:16:28 391

原创 Leetcode -- Container With Most Water

题目: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find tw

2015-08-11 15:23:02 565

原创 Leetcode -- Integer to Roman

题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.分析:罗马数字,转到阿拉伯数字是相当有规律的。比如9 -- IX, 90 -- XC, 99  -- XCIX思路:map形式,将所有特殊的都存储起来

2015-08-08 17:40:46 336

原创 Leetcode -- Roman to Integer

题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字:‘I’ -- 1, ‘V’ -- 5, ‘X’ -- 10, ‘L‘ -- 50, ’C‘ -- 100, ’D‘ -- 500, ’M‘

2015-08-08 11:57:32 314

原创 Leetcode -- Longest Palindromic Substring

题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.这个问题,跟LCS的解题思路上

2015-07-30 00:17:14 377

原创 git 首次将本地文件上传到服务器和git常用命令

1. 在服务器,新建一个文件夹mkdir matrixwave.git进入该文件夹 设置文件夹属性,是多人可访问的。git init --bare -- shared2.本地 新建一个文件夹  mkdir matrixwave_git进入该文件夹 git clone ssh:[email protected]/git/lijing.lin/mat

2015-07-26 10:35:38 5104

原创 BFM算法轮廓--基于文章 A Boundary-Fragment-Model for Object Detection

这篇文章提出根据物体的边缘检测物体类别的方法。根据某一策略提取具有辨别能力的边缘片段(boundary fragments),创建codebook,codebook entries携带着物体距心的信息,使用boosting的方法,将week detector组合成strong detector,或者说是strong “Boundary-Fragment-Model”(BFM)detector。BF

2014-07-19 10:02:33 1832

空空如也

空空如也

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

TA关注的人

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