码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
Convertion of grey code and binary 格雷码和二进制数之间的转换
以下转换代码摘自维基百科 Wikipedia:/* The purpose of this function is to convert an unsigned binary number to reflected binary Gray code. Th...
分类:其他好文   时间:2015-03-05 14:38:54    阅读次数:171
数据结构练习 00-自测4. Have Fun with Numbers (20)
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 2469135...
分类:其他好文   时间:2015-03-05 14:38:01    阅读次数:206
【leetcode】Max Points on a Line(hard)☆
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.思路:自己脑子当机了,总是想着斜率和截距都要相同。但实际上三个点是一条直线的话只要它们的斜率相同就可以了,...
分类:其他好文   时间:2015-03-05 14:27:52    阅读次数:132
***CI查询辅助函数:insert_id()、affected_rows()
查询辅助函数$this->db->insert_id()这个ID号是执行数据插入时的ID。$this->db->affected_rows()Displays the number of affected rows, when doing "write\" type queries (insert,...
分类:其他好文   时间:2015-03-05 14:16:49    阅读次数:242
1041. Be Unique
Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1, 104]. The first one who bets on ...
分类:其他好文   时间:2015-03-05 13:02:13    阅读次数:126
一段处理百分数的js代码
function percent(s, e, i){ s = Number(s), isNaN(s) && (s = "0"); var n = "%"; return e === !1 && (n = ""), parseFloat((100 * s).toFixed(i)) + n}s 需...
分类:Web程序   时间:2015-03-05 12:52:37    阅读次数:139
几种排序算法小结
插入排序, O(n^2), 从头到尾, 将较小的放在前面/* insertion sort ascending order */ #include int main(){ int n, array[1000], c, d, t; printf("Enter number of element...
分类:编程语言   时间:2015-03-05 12:36:44    阅读次数:232
第一次刷leetcode小结
LeetCode 上不会的Reverse IntegerSingle Number II斐波那契数列 非递归算法Maximum Subarray 维持最大值Integer to RomanSort ColorsPopulating Next Right Pointers in Each Node 怎...
分类:其他好文   时间:2015-03-05 12:15:22    阅读次数:161
N-Queens II
N-Queens II问题:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions思路: 典型的DFS方法+....
分类:其他好文   时间:2015-03-05 12:11:36    阅读次数:123
【SQL】利用Row_Number() 实现分组查询
有一表如左图,现在需要实现查询每个组(groupid)的前两条记录。如何实现?第一种方式用unionall这个不解释。不过在高版本SQLServer中利用Row_Number()函数可以实现,语句如下: SELECT*FROM( SELECTROW_NUMBER()OVER(PARTITIONBYgroupidORDERBYid)ASrowid,*FROMdbo.test)xWHE..
分类:数据库   时间:2015-03-05 10:59:44    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!