摘要: 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 阅读(199) 评论(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 阅读(160) 评论(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 阅读(296) 评论(0) 推荐(0) 编辑