自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 LeetCode之81. Search in Rotated Sorted Array II.cpp

题目原文:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]).You are given a target value to search. If found...

2018-05-17 23:45:18 182

原创 LeetCode之33. Search in Rotated Sorted Array

题目原文:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to search. If found...

2018-05-17 23:41:24 207

原创 LeetCode之80. Remove Duplicates from Sorted Array II

题目原文:Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for another array, you must do this by ...

2018-05-16 23:42:24 180

原创 LeetCode之26. Remove Duplicates from Sorted Array

题目原文:Given a sorted array nums, 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 by modi...

2018-05-16 23:35:23 134

原创 常量指针与指针常量之区别

在说常量指针与指针常量之前,先来看一看一个普通指针的使用int *pa 大家知道pa代表一个指向int类型值的指针.用另一种方式解读为:取pa所指向的地址内的值后,其值类型为int应该说,编译器只认识的是int型,int*型是不存在的int *pa 应该看作  int (*pa)                   而非 (int*) pa               

2016-07-01 18:10:31 444

原创 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: T

2016-06-26 14:15:26 392

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

2016-06-26 14:08:04 348

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

2016-06-26 13:59:35 380

原创 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.Note: The solution set must

2016-06-26 13:53:47 289

原创 LeetCode之14_Longest Common Prefix

题目原文:Write a function to find the longest common prefix string amongst an array of strings.题意分析:传入多个存储在vector容器中的字符串,计算其公共最长前缀,公共最长前缀要求是连续的,与动态规划的最长公共子序列不同为减少比较次数,可以逐个寻找两个字符串之间

2016-06-26 13:40:35 395

原创 LeetCode之13_Integer to Roman

题目原文:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.题意分析:把一个给出的罗马数字转换成为阿拉伯数字表示的整数解题时将罗马数字对应的阿拉伯数字依次转换出来即可,需要注意,如果存在左边的罗

2016-06-26 13:16:14 383

原创 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.Subscribe to see which companies asked this question题目分析:将数字转换为

2016-06-16 23:08:44 448

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

2016-06-16 22:18:44 359

原创 LeetCode之10_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 enti

2016-06-16 22:03:25 476

原创 LeetCode之9_Palindrome Number

题目原文:Determine whether an integer is a palindrome. Do this without extra space.题意分析:不使用额外空间,判断给定的一个整数是否为回文整数。如果只是求回文数字很简单,题目的难度在于不使用额外的空间(此处认为除了传入参数,临时变量的使用为额外空间,运行过程中产生的栈对象不考虑)此处判断首尾是

2016-05-15 01:29:52 295

原创 LeetCode之8_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 po

2016-04-04 23:50:12 343

原创 LeetCode之7_Reverse Integer

题目原文: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Subscribe to see which companies asked this question 分析:将整数倒

2016-04-04 19:02:32 339

原创 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)P A H N

2016-04-04 18:58:57 318

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

2016-04-04 18:29:40 250

原创 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)).Subscribe t

2016-04-04 18:23:00 281

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

2016-04-04 18:07:42 292

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

2016-04-04 17:58:23 316

转载 java调用webservice并解析json字段

转载自:http://www.jb51.net/article/45025.htmimport java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.Reader;import ja

2016-01-07 15:01:22 3842

原创 c++内存分配之new、operator new、placement new分析

1 new运算符new 是c++中的内置操作符,用于内存的申请和对象的初始化构造。其使用方式为:Ø  A* a = new A; //调用throwing版本,可抛出异常Ø  A* a = new(std::nothrow) A; //调用nothrow,不抛出异常Ø  A* a = new(ptr) A;  //调用placementnew版本 按照其执行顺序,new

2015-10-07 23:27:31 460

原创 动态链接库的应用

隐式链接DLL代码://dll2.cppint add2(int a, int b){ return a+b;}int sub(int a, int b){ return a-b;}//dll1.h#ifdef DLL1_API#else#define DLL1_API _declspec(dllimport)#endifDLL1_AP

2015-08-10 00:35:02 452

原创 命名管道客户端及服务器端简单代码示例

服务器端代码//服务器端源码#include #include using namespace std; int main(void) { TCHAR strPipeName[] = L"////.//pipe//feng"; /* PSECURITY_DESCRIPTOR psd; psd = (PSECURITY_DESCRIPTO

2015-08-10 00:20:45 1235

原创 Effective C++之3 资源管理

Effective c++之资源管理介绍,包括智能指针的使用及在拷贝对象和新声明对象时应当注意的事项。

2014-11-07 15:13:37 629

原创 LeetCode之1_Two Sum

LeetCode之Two Sum解题分析,nlogn 的两端迫近查找方法。

2014-11-07 10:49:24 512

原创 LeetCode之147_Insertion Sort List

题目:Sort a linked list using insertion sort.分析:单链表的插入

2014-11-04 18:12:43 560

原创 LeetCode之148_Sort List

LeetCode之Sort List时间复杂度为O(n log n),空间复杂度为常量的单链表排序算法

2014-11-01 19:22:35 813

原创 ubuntu安装配置搜狗拼音输入法

由于ubuntu自带的汉语输入法实在是不太好用,于是

2014-11-01 13:23:00 1578

原创 ubuntu显卡驱动安装

Ubuntu下的显卡驱动安装

2014-11-01 12:59:01 1187 1

原创 Effective C++之2 构造/析构/赋值运算

条款05:了解C++默认编写并调用的函数a)       当C++处理一个类之后,如果编写者没有声明,编译器就会默认生成一个copy构造函数,一个copy assignment操作符(即等号操作符)和一个析构函数,并且这些函数都是public和inline的属性。b)       对象在初始化的同时进行赋值,如student s1 = s2;调用的不是等号操作符,而是拷贝构造函数,

2014-10-31 17:38:46 574

转载 人生没有最佳时刻

之前看过一篇文章,原文叫人生没有最佳时机,文章大概说了以下内容:■ 人生里所谓的绝佳机会,无关你准备得多好,而是取决于你是否有勇气做出改变。■ 别人觉得你疯了也无所谓■ 全然地为自己负责■ 人生就像打电动——关关难过关关过■ 生命不是线性的,唯一真实的就是当下■ 不再有人对你施压,除了你自己的原则■ 恐惧带来成长■ 资源永远不够用

2014-10-22 17:16:08 698

原创 Effective C++之1 让自己习惯C++

条款01:视C++为一个语言联邦

2014-10-17 19:04:07 644

原创 RSA加密算法加密与解密过程解析

RSA加密算法剖析

2014-10-17 10:57:32 27117

转载 互联网协议入门二

分析了互联网的总体构思,从下至上,每一层协议的设计思想。这是从设计者的角度看问题,今天我想切换到用户的角度,看看用户是如何从上至下,与这些协议互动的。(接上文)七、一个小结先对前面的内容,做一个小结。我们已经知道,网络通信就是交换数据包。电脑A向电脑B发送一个数据包,后者收到了,回复一个数据包,从而实现两台电脑之间的通信。数据包的结构,基本上是下面这样:发送这个包,需要

2014-10-16 17:52:56 581

转载 互联网协议入门一

转载自:我们每天使用互联网,你是否想过,它是如何实现的?全世界几十亿台电脑,连接在一起,两两通信。上海的某一块网卡送出信号,洛杉矶的另一块网卡居然就收到了,两者实际上根本不知道对方的物理位置,你不觉得这是很神奇的事情吗?互联网的核心是一系列协议,总称为”互联网协议”(Internet Protocol Suite)。它们对电脑如何连接和组网,做出了详尽的规定。理解了这些协议,就理解了互

2014-10-16 17:47:07 626

原创 coredump分析

1.什么是coredump?

2014-10-16 17:34:53 2117

转载 C编译过程解析

c编译过程  编译的概念:编译程序读取源程序(字符流),对之进行词法和语法的分析,将高级语言指令转换为功能等效的汇编代码,再由汇编程序转换为机器语言,并且按照操作系统对可执行文件格式的要求链接生成可执行程序。    编译的完整过程:C源程序-->预编译处理(.c)-->编译、优化程序(.s、.asm)-->汇编程序(.obj、.o、.a、.ko)-->链接程序(.exe、.elf、.axf

2014-10-13 20:06:18 690

空空如也

空空如也

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

TA关注的人

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