- 博客(33)
- 资源 (7)
- 收藏
- 关注
原创 【一天一道LeetCode】#38. Count and Say
一天一道LeetCode系列(一)题目 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21
2016-04-30 22:28:54 587
原创 【一天一道LeetCode】#32. Longest Valid Parentheses
一天一道LeetCode系列(一)题目 Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(()”, the longest valid parentheses
2016-04-28 21:48:24 716
原创 【一天一道LeetCode】#31. Next Permutation
一天一道LeetCode系列(一)题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it
2016-04-27 15:13:18 581
原创 【一天一道LeetCode】#29. Divide Two Integers
一天一道LeetCode系列(一)题目 Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT.(二)解题这题看起来很简单,一开始想到的方法就是从0开始一次累加除数,一直到比被除数大为止,好无悬念,这样做的结果就是超时了
2016-04-26 18:02:45 614
原创 【一天一道LeetCode】#28. Implement strStr()
一天一道LeetCode系列(一)题目 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.(二)解题第一种解法:朴素匹配算法/*两个指针,分别指向两个字符串的首字符如果相等则一起向后移
2016-04-25 16:34:17 3661
原创 【一天一道LeetCode】#27. Remove Element
一天一道LeetCode系列(一)题目 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 wi
2016-04-25 14:41:55 690
原创 【一天一道LeetCode】#26. Remove Duplicates from Sorted Array
一天一道LeetCode系列(一)题目 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 mus
2016-04-25 14:41:15 1019
原创 【阅读笔记】计算机网络 第五版 阅读笔记(索引目录)
计算机网络 第五版阅读笔记 索引第一章:概述【计算机网络 第五版】阅读笔记之一:概述第二章:物理层【计算机网络 第五版】阅读笔记之二:物理层第三章:数据链路层【计算机网络 第五版】阅读笔记之三:数据链路层第四章:网络层【计算机网络 第五版】阅读笔记之四:网络层第五章:运输层【计算机网络 第五版】阅读笔记之五:运输层
2016-04-23 16:00:09 1922
原创 【一天一道LeetCode】#25. Reverse Nodes in k-Group
一天一道LeetCode系列(一)题目 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 s
2016-04-23 15:56:07 583
原创 【一天一道LeetCode】#24. Swap Nodes in Pairs
一天一道LeetCode系列(一)题目 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 on
2016-04-22 21:12:48 568
原创 【一天一道LeetCode】#23. Merge k Sorted Lists
一天一道LeetCode系列(一)题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.(二)解题合并K个已拍好序的链表。剑指上有合并两个已排好序的链表的算法,那么K个数,我们可以采用归并排序的思想,不过合并函数可能需要修改一下,换成合并两个已排好
2016-04-21 16:21:57 758
原创 【一天一道LeetCode】#22. Generate Parentheses
一天一道LeetCode(一)题目 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-04-20 22:00:27 639
原创 【面试笔试算法】牛客网一站通Offer编程题2016.4.19
牛客网一站通offer(一)字符串变形1. 题目: 对于一个给定的字符串,我们需要在线性(也就是O(n))的时间里对它做一些变形。首先这个字符串中包含着一些空格,就像”Hello World”一样,然后我们要做的是把着个字符串中由空格隔开的单词反序,同时反转每个字符的大小写。比如”Hello World”变形后就变成了”wORLD hELLO”。输入描述: 给定一个字符串s以及
2016-04-20 15:29:24 3222 3
原创 【linux学习笔记】在ubuntu下使用QT Cmake支持C++11
今天在ubuntu下使用QT来进行C++编程,选择了Cmake,当用到initializer_list的时候提示不支持C++11,现提供一下解决方案:错误提示: error: This file requires compiler and library support for the \ ISO C++ 2011 standard. This support is currently e
2016-04-20 11:44:33 3016
原创 【一天一道LeetCode】#10. Regular Expression Matching
一天一道LeetCode(一)题目 Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element. The
2016-04-19 00:09:29 903 2
原创 【一天一道LeetCode】#21. Merge Two Sorted Lists
一天一道LeetCode系列(一)题目 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.(二)解题这题是剑指offer上的老题了,剑指上面用的是递归,我写了个非递
2016-04-17 22:37:10 678
原创 【一天一道LeetCode】#20. Valid Parentheses
一天一道LeetCode系列(一)题目 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and
2016-04-17 22:03:31 667
原创 【一天一道LeetCode】#19. Remove Nth Node From End of List
一天一道LeetCode系列(一)题目 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
2016-04-16 22:45:42 491
原创 【一天一道LeetCode】#18. 4Sum
一天一道LeetCode(一)题目 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.
2016-04-15 21:07:16 495
原创 【一天一道LeetCode】#17. Letter Combinations of a Phone Number
一天一道LeetCode(一)题目 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 be
2016-04-14 17:18:37 646
原创 【一天一道LeetCode】#16. 3Sum Closest
一天一道LeetCode系列(一)题目: 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 in
2016-04-13 21:28:09 533
原创 【面试笔试算法】Problem 9: 腾讯2016年研发实习笔试题:最长回文子串
(一)题目 问题:求给定字符串s的回文(palindrome)子串中,长度最大的回文子串的长度。 回文(palindrome)是指从左往右读和从右往左读字符串,看到的字符串都是一样的。比如“cabbeaf”,回文子串包括”c”“aba”“abba”等,最长的子串是“abba”,长度为4. 程序输入:“cabbeaf” 程序输出:4(二)解题当时笔试的时候没有AC,线下在
2016-04-12 16:41:12 954
原创 【一天一道LeetCode】#15 3Sum
一天一道LeetCode系列(一)题目 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
2016-04-12 11:40:04 694
原创 【一天一道LeetCode】#14 Longest Common Prefix
一天一道LeetCode系列(一)题目: Write a function to find the longest common prefix string amongst an array of strings.(二)题意求一组字符串中的最长前缀字符串。 举例:字符串组:abc,ab,abdef,abws 最长前缀字符串:ab我的解法是先求出这组字符串中最短的,然后依次匹配,遇到不同
2016-04-10 22:50:59 508
原创 【一天一道LeetCode】#13. Roman to Integer
一天一道LeetCode系列(一)题目 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.(二)解题和上一题相反,这题将罗马数字转换成整形数。 注意到 4,9,40,90,400,900这些特殊的数字的区别就不难写出代码
2016-04-08 15:45:53 561
原创 【一天一道LeetCode】#12 Integer to Roman
一天一道LeetCode系列(一)题目 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
2016-04-08 15:40:59 547
原创 【一天一道LeetCode】#11Container With Most Water
一天一道LeetCode系列(一)题目 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) an
2016-04-06 23:24:20 562
原创 【一天一道LeetCode】#9. Palindrome Number
一天一道LeetCode系列(一)题目 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of conver
2016-04-05 15:04:28 600
原创 【一天一道LeetCode】#8. String to Integer (atoi)
一天一道LeetCode(一)题目 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
2016-04-04 16:42:57 528
原创 【一天一道LeetCode】#7. Reverse Integer
一天一道LeetCode系列(一)题目 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321(二)解题这题看上去很简单,动笔一挥之下,写出如下代码:class Solution {public: int reverse(int x) {
2016-04-04 15:42:43 694
原创 【一天一道LeetCode】#6 ZigZag Conversion
一天一道LeetCode系列(一)题目 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)
2016-04-03 16:47:22 531
原创 【一天一道LeetCode】#5 Longest Palindromic Substring
一天一道LeetCode(一)题目 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-04-02 17:51:39 644
原创 【一天一道LeetCode】#4 Median of Two Sorted Arrays
一天一道LeetCode(一)题目 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)).给定两个排好序的数
2016-04-01 14:58:38 1082 4
【Visual C++】游戏编程代码\【Visual C++】游戏编程学习笔记之九:回合制游戏demo(剑侠客VS巡游天神)
2015-03-21
【Visual C++】游戏编程代码\【Visual C++】游戏编程开发笔记六:多背景循环动画
2015-03-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人