自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 资源 (5)
  • 收藏
  • 关注

原创 排序算法

昨天刷leetcode用到了排序算法,简单整理了一下冒泡排序和快速排序,今天抽时间把其他的几个排序也整理一下。1.插入排序—直接插入排序(Straight Insertion Sort)将元素插入到一个已经排好序的数组中,形成一个新的有序数列,重复这个动作,直到完成。重点:以第一个为初始元素,往后遍历,如果比前一个大,就接着往后遍历,否则就是寻找到目标点。举个例子:{1,2,4

2016-07-31 15:39:58 152

原创 LeetCode进阶之路(Next Permutation)

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible

2016-07-30 23:23:05 254

原创 LeetCode进阶之路(Substring with Concatenation of All Words)

You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and

2016-07-30 23:05:05 203

原创 LeetCode进阶之路(Divide Two Integers)

Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.题目:两个数相除,不能用除法、乘法。思路:第一个反映应该是用位移,a*2^b = apublic int divide(int dividend,

2016-07-28 22:11:27 251

原创 LeetCode进阶之路(Implement strStr())

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.题目:这题目是要找出第一个相同串的位置。思路:相当简单,遍历字符串,根据第二个串的长度找相同长的串比较就行,找到第一个即结束遍历

2016-07-28 21:58:35 153

原创 LeetCode进阶之路(Remove Element)

Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.

2016-07-28 21:55:05 160

原创 LeetCode进阶之路(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 with

2016-07-28 21:50:45 155

原创 LeetCode进阶之路(Reverse Nodes in k-Group)

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is

2016-07-27 22:40:52 277

原创 【Java】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

2016-07-25 23:43:59 227

原创 LeetCode进阶之路(Merge k Sorted Lists)

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.题目:把k个有序的链表合并成一个新的链表。思路:采用合并两个链表的方法,把K个链表的值都取出来放到list里面,排序后创建新的链表。public class Solution {

2016-07-25 23:39:51 171

原创 LeetCode进阶之路(Generate Parentheses)

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())

2016-07-24 23:58:52 179

原创 LeetCode进阶之路(Merge Two Sorted Lists)

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

2016-07-24 23:50:31 164

原创 LeetCode进阶之路(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

2016-07-21 23:21:20 175

原创 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, the

2016-07-20 23:58:40 186

原创 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: The solution

2016-07-19 00:08:52 297

原创 LeetCode进阶之路(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 st

2016-07-18 00:17:29 255

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

2016-07-15 23:53:13 231 1

原创 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: The solution set must not contain

2016-07-14 23:57:48 333

原创 LeetCode进阶之路(Longest Common Prefix)

Write a function to find the longest common prefix string amongst an array of strings.题目:在一个字符串数组中,求最长的初始串。思路:先比较前两个,得到最长初始子串,之后拿这个子串去和第三个相比较,以此类推;public String longestCommonPrefix(String[] s) {

2016-07-14 22:53:16 204

原创 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.题目:把Roman数字转换成整型,范围是1-3999;通过这个问题,发现自己一个很大的缺陷,碰到问题首先思考的是最简单的方法,然后就动手写,最后发现这种

2016-07-13 23:31:59 217

原创 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.把整数转成罗马数字(范围是1-3999)。罗马数字:1~9: {"I", "II", "III", "IV", "V", "VI", "VII",

2016-07-12 23:36:41 268

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

2016-07-12 15:08:51 171

原创 LeetCode进阶之路(Regular Expression Matching)

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input

2016-07-12 00:06:22 213

原创 LeetCode进阶之路(Palindrome Number)

Determine whether an integer is a palindrome. Do this without extra space.1.负数直接返回false;2.正书如果是回文数字,头尾颠倒之后相等;public boolean isPalindrome(int x) { if(x < 0) { return false; } int su

2016-07-10 19:32:42 170

原创 LeetCode进阶之路(Reverse Integer)

又是一道充满坑的题目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 p

2016-07-09 23:41:34 173

原创 LeetCode进阶之路(Reverse Integer)

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321看题目第一眼,我艹,这么简单。仔细一想肯定不会这么容易,leetcode这么高大上的平台怎么会出这种题目,肯定有坑。但是不管它,写了再说,刷刷的几下就完成,用例一跑,灭有问题提交,wtf,1534236

2016-07-08 23:17:54 252

原创 LeetCode进阶之路(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 l

2016-07-07 23:17:25 439

原创 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.求最长回

2016-07-07 00:22:09 172

原创 LeetCode进阶之路(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)).Example 1:nums1

2016-07-06 00:10:59 150

原创 LeetCode进阶之路(Longest Substring Without Repeating Characters)

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "

2016-07-05 00:27:07 144

原创 LeetCode进阶之路(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

2016-07-03 23:25:35 294

原创 LeetCode进阶之路(twoSum)

题目: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.给你int数组nums[]和一个int值t

2016-07-03 22:15:15 301

Android 4.4 SDK本地离线版

Android 4.4 SDK本地离线版

2014-07-25

Android开发必备资料之50例源码汇总

Android开发必备资料之50例源码汇总,新手参考

2014-07-25

武汉理工FPGA 论文

FPGA论文 选修专用 fpga 毕业论文

2012-12-07

图像 盲分离

图像的盲分离matlab

2012-06-30

信号的盲分离 完整的报告加程序

信号的盲分离 完整的报告加程序

2012-06-30

空空如也

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

TA关注的人

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