会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
羽加迪姆勒维奥萨
http://duangao.github.io/
首页
新随笔
订阅
管理
上一页
1
2
3
4
5
下一页
2014年10月29日
变动数据模拟cons
摘要: ## source code```racket#lang planet neil/sicp(define (mycons x y) (define (set-first aim-data) (set! x aim-data)) (define (set-second aim-data)(set...
阅读全文
posted @ 2014-10-29 14:55 羽加迪姆勒维奥萨
阅读(249)
评论(0)
推荐(0)
2014年10月27日
string to integer
摘要: 1 class Solution { 2 public: 3 //计算一个整数的位数,在溢出判断中使用 4 int bit_length(int n) { 5 int l=0; 6 while(n!=0)...
阅读全文
posted @ 2014-10-27 22:22 羽加迪姆勒维奥萨
阅读(203)
评论(0)
推荐(0)
single number
摘要: 1 class Solution {2 public:3 int singleNumber(int A[], int n) {4 int result=A[0];5 for(int i=1;i<n;i++)6 result^=A[i];...
阅读全文
posted @ 2014-10-27 21:53 羽加迪姆勒维奥萨
阅读(158)
评论(0)
推荐(0)
罗马数字转为阿拉伯数字
摘要: 1 /* I:1 ; V-5;X-10;L-50;C-100;D-500;M-1000*/ 2 class Solution{ 3 vector tokens; 4 vector token_value; 5 public: 6 /*divide the strin...
阅读全文
posted @ 2014-10-27 21:51 羽加迪姆勒维奥萨
阅读(420)
评论(0)
推荐(0)
整数逆序
摘要: 1 class Solution 2 { 3 public: 4 5 int reverse(int x){ 6 int result=0; 7 while(x!=0) 8 { 9 ...
阅读全文
posted @ 2014-10-27 21:46 羽加迪姆勒维奥萨
阅读(115)
评论(0)
推荐(0)
回文数字
摘要: 1 bool isPalindrome(int x) { 2 int result=0; 3 //注意下面会修改x的值,所以提前保留 4 int copy_x=x; 5 if(x<0) 6 return...
阅读全文
posted @ 2014-10-27 21:45 羽加迪姆勒维奥萨
阅读(160)
评论(0)
推荐(0)
回文字符串
摘要: 1 class Solution { 2 public: 3 bool isPalindrome(string s) { 4 //清空string内部所有不是字母的内容,要注意的是erase删除后返回其下一个元素,利用这点来连续删除,若使用i++则会导致运行时错误 5 ...
阅读全文
posted @ 2014-10-27 21:44 羽加迪姆勒维奥萨
阅读(125)
评论(0)
推荐(0)
count and say
摘要: 1 ``` 2 class Solution{ 3 string result; 4 public: 5 //根据数组前一个数,count and say 构造出后一个数 6 void generate(string s,string &result) 7 ...
阅读全文
posted @ 2014-10-27 21:41 羽加迪姆勒维奥萨
阅读(243)
评论(0)
推荐(0)
对称树
摘要: 闲着没事,做两道题玩玩,有一些地方还是有一些意思的;对称树 1 ```c++ 2 bool isSymmetric(TreeNode *root) 3 { 4 //约定空树是对称的 5 if(root==NULL) 6 return true; 7 else 8 return isEqual(roo...
阅读全文
posted @ 2014-10-27 21:31 羽加迪姆勒维奥萨
阅读(355)
评论(0)
推荐(0)
2014年10月25日
有用的小工具、书本推荐
摘要: ##书籍### CSAPP (深入理解计算机系统)+ 对于计算机的硬件层面介绍十分详尽,配合课后习题和lab一起,效果非常好,比国内的组原啊的很多教材高明到不知道哪里去了+ 强烈推荐,并且中文版的翻译很好,丝毫没有任何的不适感### 程序员的自我修养+ 介绍了和链接有关的很多知识### SICP+ ...
阅读全文
posted @ 2014-10-25 21:27 羽加迪姆勒维奥萨
阅读(188)
评论(0)
推荐(0)
上一页
1
2
3
4
5
下一页