摘要: Notes from C++ PrimerFile StateCondition state is used to manage stream state, which indicates if the stream is available or recoverable.State of stre... 阅读全文
posted @ 2015-01-27 22:17 kid551 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 1. Define variable return_code to record the function's status.int return_code = 0;2. Define the exit flag:exit_flag, which is used by goto. This flag... 阅读全文
posted @ 2015-01-27 17:43 kid551 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Notes from C++PrimerIn general, head file includes: class definition, declaration of extern variable and declaration of function.1. Head file is used ... 阅读全文
posted @ 2015-01-27 10:48 kid551 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Compile Two Files:$ CC -c Main.cc Sales_item.cc # by default generates a.exe # some compilers generate a.o... 阅读全文
posted @ 2015-01-27 09:54 kid551 阅读(224) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-01-16 10:58 kid551 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 最常用的键有F3(运行代码)、F6(查看log信息)、Ctrl + / (注释代码)、Ctrl + Shift + / (取消代码注释)SAS系统一共有4类快捷键,其中部分有重复, 第一类可自定义。1. Default Key Definitions under Windows这个可以点F9快捷键或... 阅读全文
posted @ 2015-01-14 09:33 kid551 阅读(740) 评论(0) 推荐(0) 编辑
摘要: Problem StatementYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes ... 阅读全文
posted @ 2014-12-24 15:09 kid551 阅读(123) 评论(0) 推荐(0) 编辑
摘要: It's a very elegant summary of regular expression from The AWK Programming Language.1. The regular expression metacharacters are:\ ^ $ . [ ] | ( ) * +... 阅读全文
posted @ 2014-12-22 12:33 kid551 阅读(156) 评论(0) 推荐(0) 编辑
摘要: It's obvious an DP problem.Let's define:$dp[i] := $ the maximum sum of subarray in the first $i$ elements.From the base point, the optimal subarray ma... 阅读全文
posted @ 2014-12-09 15:43 kid551 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Problem StatementGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1... 阅读全文
posted @ 2014-11-30 09:57 kid551 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Problem Statement描述 一日,崔克茜来到小马镇表演魔法。其中有一个节目是开锁咒:舞台上有 n 个盒子,每个盒子中有一把钥匙,对于每个盒子而言有且仅有一把钥匙能打开它。初始时,崔克茜将会随机地选择 k 个盒子用魔法将它们打开。崔克茜想知道最后所有盒子都被打开的概率,你能帮助她回答这个问... 阅读全文
posted @ 2014-11-24 15:33 kid551 阅读(365) 评论(0) 推荐(0) 编辑
摘要: Problem StatementGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindr... 阅读全文
posted @ 2014-11-22 12:02 kid551 阅读(119) 评论(0) 推荐(0) 编辑
摘要: My naive $O(n^2)$ running time solution:class Solution {public: int jump(int A[], int n) { if(1 == n) return 0; int maxL = (1= (i-j) ... 阅读全文
posted @ 2014-11-22 01:32 kid551 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Problem StatementGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1,... 阅读全文
posted @ 2014-11-22 01:05 kid551 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Loop List is very common in interview. This article we give a more strict shortstatement about its solving.One method to check if there's a loop in a ... 阅读全文
posted @ 2014-11-22 00:49 kid551 阅读(280) 评论(0) 推荐(0) 编辑
摘要: A fast method to determine the number is odd or even:total & 0x1 //true, if total is oddtotal & 0x1 //false, if total is evenProblem StatementThere ar... 阅读全文
posted @ 2014-11-21 19:48 kid551 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Let'sbegin witha naive method.We first need to sort the array A[n]. And we want to solve the problem by iterating through A from beginning and ending.... 阅读全文
posted @ 2014-11-21 19:20 kid551 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Problem StatementImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangeme... 阅读全文
posted @ 2014-11-21 16:51 kid551 阅读(167) 评论(0) 推荐(0) 编辑
摘要: The maximum product of sub-arrays in $[1, n]$ can be divided by 3 cases:A[n] is the maximum product of all sub-arrays in [1, n].The array which has th... 阅读全文
posted @ 2014-11-21 16:29 kid551 阅读(298) 评论(0) 推荐(0) 编辑