自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

一只不断成长的藏獒

没什么可以一蹴而就,总会有低迷的时候,但请坚持,相信,只要坚持下去,你总会有变得强大的时候,所以努力吧!

  • 博客(7)
  • 资源 (7)
  • 收藏
  • 关注

原创 Remove Nth Node From End of List

由于一般的链表不包含表头,所以使得处理第一个节点相较于其他节点具有特殊性,所以我的思路是先转化为含表头的的链表,再进行操作,最后还原成没有表头的链表,并返回。#include using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x): val(x), next(NULL) {} }; c

2015-05-13 21:00:29 445

原创 Longest Common Prefix

本题并没有太大的难度,有两点值得记忆:其一:由于用到vector容器,所以应包含头文件vector;其二:vector不支持初始化列表方式初始化,即vector strs = {"abcdef", "abcdrgh", "abcthu"}会导致编译出错。 #include #include #include using namespace std; class Solution { publi

2015-05-12 22:00:48 410

原创 Palindrome Number

今天编写代码超没有感觉,本道题并不难,但在编写的过程中每敲一个字符,都感觉到违和感。路漫漫其修远兮,淡定,要坐得住。 #include using namespace std; class Solution { public: bool isPalindrome(int x) { if(x < 0) return false; int tmp = x; if(tm

2015-05-11 22:02:47 357

原创 String to Integer (atoi)

首先根据位数初步判断待转换的数是否超过int数据类型的表示范围,接着用long long类型承载待转换的数,判断是否超过int数据类型的范围,最后将long long类型变量承载的数赋值给int类型的变量。这里编译器会发出警告,数据丢失。暂时忽略,以后继续研究。#include #include #include using namespace std; class Solution { pub

2015-05-10 15:40:35 631

原创 ZigZag Conversion

解决本题时本地测试通过,但在提交代码时出现memory limit exceed。原因是并未考虑输入numRows为小于等于1的情况。#include #include using namespace std; class Solution { public: string convert(string s, int numRows) { if(numRows <= 1) re

2015-05-08 14:46:36 398

原创 Reverse Integer

对于有符号int类型的整数,其取值范围为-2^31~2^31-1,即-2147483648~2147483647,所以当输入为-2147483648时并不能这样做:int a; a = -x;即不能像其他负数那样直接取反,需要单独处理。 #include using namespace std; class Solution { public: int reverse(int

2015-05-08 14:35:34 377

原创 归并排序代码实现

由于所选weiss教材上的归并算法p175比较复杂,各个函数之间相互调用导致逻辑混乱,索性自己写了一个int *mergeSort(int *a, int N) { int *reArray = new int[N]; int *temp1,*temp2; int i = 0, j = 0, k = 0; int length1,length2; if(1 == N) { reArr

2015-05-05 10:19:09 454

编译器设计 第二版(engineering a compiler 中文版)绝版书

自己买的 编译器设计 第二版(engineering a compiler 中文版)绝版书

2018-03-16

The Algorithm Design Manual-Steve S. Skiena Second Edition

The Algorithm Design Manual-Steve S. Skiena second edition

2015-07-08

The Algorithm Design Manual-Steve S. Skiena

The Algorithm Design Manual-Steve S. Skiena

2015-07-08

程序员面试宝典第四版高清完整PDF

程序员面试宝典第四版PDF,内容与纸质书一样,但是页数不一样

2015-03-08

c和指针课后题答案(完整版)

c和指针课后题答案(完整版),内容为 c和指针课后解答中未包含的所有解答,和c和指针课后解答配套使用。

2014-04-25

空空如也

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

TA关注的人

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