自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1.EdgeDetection_1.1.DeepEdge

1. Single-Scale Architecture (1) The KNet is an appropriate model for our setting as it has been trained over a large number of object classes (the 1000 categories of the ImageNet dataset) and an

2016-09-27 14:51:48 1645

原创 leetcode-24 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. You ma

2016-03-25 16:49:28 237

原创 leetcode-23 Insertion Sort List

Sort a linked list using insertion sort. ////////////////////////////////////////////////////////////////////////// // start: Sort list using insert sort ListNode *findInsertPos(ListNode 

2016-03-25 16:49:08 235

原创 leetcode-22 Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 可以复用两个链表合并,每次合并两个,时间O(n1+n2+...),空间复杂度O(1) ////////////////////////////////////////////

2016-03-25 16:48:47 242

原创 leetcode-21 Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. e new list should be made by splicing together the nodes of the first two lists. ////////////////////////////////////////////////////

2016-03-25 16:48:15 246

原创 leetcode-20 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 valid but 

2016-03-25 16:47:50 190

原创 leetcode-19 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 linked l

2016-03-25 16:47:12 197

原创 leetcode-18 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 a quad

2016-03-25 16:46:39 197

原创 leetcode-17 Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit strin

2016-03-25 16:45:01 223

原创 leetcode-16 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 exactly

2016-03-25 16:44:28 180

原创 leetcode-15 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. For example, given array S = {-1 0 1 2 -1 -4}.

2016-03-25 16:44:01 176

原创 leetcode-14 Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings 求多个字符串的最长公共前缀。 1.纵向扫描,从位置0 开始,对每一个位置比较所有字符串,直到遇到一个不匹配。 2.横向扫描,每个字符串与第0 个字符串,从左到右比较,直到遇到一个不匹配。 ////

2016-03-25 16:43:33 158

原创 leetcode-13 Roman to Integer

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. ////////////////////////////////////////////////////////////////////////// // start

2016-03-25 16:43:01 205

转载 leetcode-11 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 two

2016-03-25 16:31:45 263

原创 leetcode-12 Integer to Roman

Given an integer, convert it to a roman numeral. 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(表示1000)。 1、相同的数字列表示

2016-03-25 16:31:06 274

原创 leetcode-10 Regular Expression Matching

Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding(前面的数字可以出现任意次,包括0次) element. Some examples: isMatch(

2016-03-25 16:30:33 289

原创 leetcode-9 Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. http://blog.csdn.net/hcbbt/article/details/44001229 1.可以先转为字符串,再判断。 2.直接算出回文的数再直接比较。  // 发现问题:回文数会出现溢出情况,所以取int高一个量级

2016-03-25 16:29:58 191

原创 leetcode-8 String to Integer

注意两个问题: 1.空格、\t、\n等符号、正负号以及它们出现的位置; 如:不规则输入,但是有效,”-3924x8fc”,”     +1" (第一个有效字符是正负号或者是数字或者空格,不是则视为无效,到第一个非数字的字符之前为止) 无效格式,” ++c”, ” ++1”,+ 413”,“abc”(正负号之后必须是数字,否则无效) 2.是否越界,若越界取最大值或最小值。 溢出

2016-03-25 16:29:21 204

原创 leetcode-7 Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 注意两个问题: 1.倒过来的数是否会越界(可以先化为long long型做); 2.负数取余和取整的操作,最好先化为正数。 ////////////////////////////

2016-03-25 16:28:21 196

原创 leetcode-6 ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) http://blog.csdn.net/zho

2016-03-25 16:22:19 225

原创 leetcode-5 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. 1.简单解法:暴力枚举 遍

2016-03-25 16:13:49 233

原创 leetcode-4 Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 1.常规方法:合并两个数组,排序,找到

2016-03-25 15:36:08 250

原创 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. Fo

2016-03-25 11:13:26 191

原创 leetcode-2 Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2016-03-18 09:49:14 188

原创 leetcode-1 TwoSum

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

2016-03-18 09:35:51 262

空空如也

空空如也

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

TA关注的人

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