- 博客(4)
- 收藏
- 关注
转载 探究操作系统的内存分配(malloc)对齐策略
我们在写程序的时候经常发现程序使用的内存往往比我们申请的多,为了优化程序的内存占用,搅尽脑汁想要优化内存占用,可是发现自己的代码也无从优化了,怎么办?现在我们把我们的焦点放到malloc上,毕竟我们向系统申请的内存都是通过它完成了,不了解他,也就不能彻底的优化内存占用。来个小例子//g++ -o malloc_addr_vec mallc_addr_vec.cpp 编译 2
2014-05-20 10:41:13
1681
原创 single number
class Solution {public: int singleNumber(int A[], int n) { // Note: The Solution object is instantiated only once and is reused by each test case. int res=0;for(int i=0;i{re
2013-10-04 15:26:29
351
原创 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 without usi
2013-10-03 23:46:02
355
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅