码迷,mamicode.com
首页 > 其他好文
Flatten Binary Tree to Linked List
题目 Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / 2 5 / \ 3 4 6 The flattened tree should look lik...
分类:其他好文   时间:2014-06-30 18:13:31    阅读次数:229
Gas Station
题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from s...
分类:其他好文   时间:2014-06-30 16:57:25    阅读次数:231
Single Number
题目 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it witho...
分类:其他好文   时间:2014-06-30 19:38:37    阅读次数:226
Single Number II
题目 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it...
分类:其他好文   时间:2014-06-30 19:23:18    阅读次数:200
RadHat搭建内网YUM源服务器
前言:随着内网linux服务器越来越多,在每台服务器上安装软件,都要先把安装盘上传上去,在配置本地yum服务,即麻烦又费时。可以在内网的一台linux服务器上安装yum服务,然后其他服务器直接修改repo文件使用yum服务就可以了。安装步骤如下:...
分类:其他好文   时间:2014-06-30 16:28:51    阅读次数:275
【剑指offer】二维数组中的查找
题目描述: 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 分析: 首先选择数组中右上角的数字。如果该数字等于要查找的数字,查找过程结束;如果该数字大于要查找的数字,剔除这个数字所在的列;如果该数字小于要查找的数字,剔除这个数字所在的行。依次类推,直到查找范围为空。...
分类:其他好文   时间:2014-06-30 20:18:42    阅读次数:154
电子邮件收发协议总结
电子邮件发送协议是一种基于“推”的协议,主要包括SMTP;邮件接收协议则是一种基于“拉”的协议,主要包括POP协议和IMAP协议,在正式介绍这些协议之前,我们先给出邮件收发的体系结构:...
分类:其他好文   时间:2014-06-30 18:50:27    阅读次数:219
【hoj】1604 cable master
简单,二分法,但是在oj上交的时候会有精度的限制,所以只能把数扩得大一点,而且在扩的时候为防止尾数会自动生成一些非零数,所以还是自己吧扩到的位置设置为0,还有输出时因为%.2lf会自己有4设5入,所以可以自己算出小数点后两位的数值,在输出,保证要求的精度 #include #include #include #define MAX 10010 using namespace std; l...
分类:其他好文   时间:2014-06-30 19:02:41    阅读次数:163
程序员的生活
文章地址:http://ryantang.me/blog/2014/06/29/efficient-life/...
分类:其他好文   时间:2014-06-30 19:01:40    阅读次数:157
Lua 与C 交换 第一篇
编译 windows上编译lua源码 cl /MD /O2 /W3 /c /DLUA_BUILD_AS_DLL *.c del *.o ren lua.obj lua.o ren luac.obj luac.o ren print.obj print.o link /DLL /IMPLIB:lua5.1.lib /OUT:lua5.1.dll *.obj link /OUT:lua.ex...
分类:其他好文   时间:2014-06-30 18:18:38    阅读次数:156
Lua 与C交互 第二篇
使用静态链接的方式 #include #include #include #ifdef __cplusplus extern "C" { #endif #include "lua/include/lua.h" #include "lua/include/lauxlib.h" #include "lua/include/lualib.h" #pragma comment (li...
分类:其他好文   时间:2014-06-30 18:28:47    阅读次数:216
Copy List with Random Pointer
题目 A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. 方法 publi...
分类:其他好文   时间:2014-06-30 19:36:33    阅读次数:163
centos 修改字符集为GB2312的方法
这几天总是被一个问题困扰着,那就是base64的加密,在centos 服务器上无法解密。经过反复测试才发现,原来是因为centos 系统没有GB2312库导致的。 加密端是在ASP.NET中处理的,解密是在centos 下使用java。ASP.NET默认采用的是GB2312字符集,所以,对应的解密也必须使用GB2312。为了成功解析,所以必须让centos 也支持GB2312。最终问题解决。 ...
分类:其他好文   时间:2014-06-30 19:22:16    阅读次数:133
【BUG】"main" prio=5 tid=1 RUNNABLE
加载超大效果图导致内存不足(GC/ANR) 浅谈ANR如何分析解决ANR...
分类:其他好文   时间:2014-06-30 18:27:48    阅读次数:208
uva 1425 - Metal(递推)
题目链接:uva 1425 - Metal 题目大意:现在要用如图机器对一块钢板进行切割,给出切割路线经过的若干个点,问可以切割成多少种不同的形状,注意切割下的为一整块。 解题思路: 由图可以得知,两条切割线是不可以相交的由题目描述可知,所有点的x坐标是不会重复的机器不会回退,也就是说钢板是朝一个方向移动的,这样的切割路线是不会产生的 所以我们定义两条切割线分别为上...
分类:其他好文   时间:2014-06-30 17:43:43    阅读次数:185
火狐浏览器中的“HttpWatch”
火狐浏览器中的“HttpWatch”...
分类:其他好文   时间:2014-06-30 19:00:38    阅读次数:219
SWIFT学习笔记01
1、Swift,用来判断option是不是nil,相当于OC的 if(option) if let name = option{ greeting = “if=====“ }else{ greeting = "else===" } 2、运行switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break。 3、//使用..创建的范围...
分类:其他好文   时间:2014-06-30 20:17:41    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!