摘要: leetcode - Remove Linked List Elements 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next;... 阅读全文
posted @ 2015-05-12 12:35 cnblogshnj 阅读(126) 评论(0) 推荐(0) 编辑
摘要: leetcode - Isomorphic StringsGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be repl... 阅读全文
posted @ 2015-05-11 16:38 cnblogshnj 阅读(255) 评论(0) 推荐(0) 编辑
摘要: leetcode - Reverse Linked List单链表逆置。/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(i... 阅读全文
posted @ 2015-05-08 17:52 cnblogshnj 阅读(113) 评论(0) 推荐(0) 编辑
摘要: leetcode -house-robberhttps://leetcode.com/problems/house-robber/Q:You are a professional robber planning to rob houses along a street. Each house has... 阅读全文
posted @ 2015-04-29 22:12 cnblogshnj 阅读(144) 评论(0) 推荐(0) 编辑
摘要: leetcode -Count and SayQ:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1... 阅读全文
posted @ 2015-04-28 23:55 cnblogshnj 阅读(156) 评论(0) 推荐(0) 编辑
摘要: leetcode -https://leetcode.com/problems/count-primes/Q:Description:Count the number of prime numbers less than a non-negative number,nHint:The number ... 阅读全文
posted @ 2015-04-27 17:32 cnblogshnj 阅读(138) 评论(0) 推荐(0) 编辑
摘要: leetcode -Longest Common PrefixQ:Write a function to find the longest common prefix string amongst an array of strings. 1 class Solution { 2 public: 3... 阅读全文
posted @ 2015-04-27 09:29 cnblogshnj 阅读(140) 评论(0) 推荐(0) 编辑
摘要: http://codevs.cn/problem/1012/题目描述Description输入二个正整数x0,y0(2 #include int x,y; bool zhi(int x) { for (int i=2;i<=sqrt(x);++i) if (x... 阅读全文
posted @ 2015-04-20 23:15 cnblogshnj 阅读(354) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){ char a1[]="hello word!"; char *p1="hello word!";// a1[2]='E';// *(p1++) = 'E'; for(int i=0; a1[... 阅读全文
posted @ 2015-04-03 11:14 cnblogshnj 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Hello world! 阅读全文
posted @ 2013-10-16 00:40 cnblogshnj 阅读(89) 评论(0) 推荐(0) 编辑