摘要: 实现算法导论快排 阅读全文
posted @ 2016-12-21 17:26 ilove 阅读(736) 评论(0) 推荐(0) 编辑
摘要: 系统ubuntu64位 Clang4.0 参考: 1 https://github.com/yangyangwithgnu/use_vim_as_ide#0.1 其中 第7章 工具链集成 2. http://clang.llvm.org/get_started.html 其中 Release Cla 阅读全文
posted @ 2016-10-08 17:20 ilove 阅读(620) 评论(0) 推荐(0) 编辑
摘要: 系统ubuntu64位 Clang4.0 参考: 1 https://github.com/yangyangwithgnu/use_vim_as_ide#0.1 其中 第7章 工具链集成 2. http://clang.llvm.org/get_started.html 其中 Release Cla 阅读全文
posted @ 2016-10-08 17:20 ilove 阅读(6518) 评论(0) 推荐(0) 编辑
摘要: 问题 求整数中1的个数 原理 一个数n若不为0,从数的最低为到最高位,第一个为1 的位记为 i ,则减去 1 之后,改为变为0,i 右边的所有位都变为1,因此 n & (n-1)可得 n中剩余比 i 更高位序 的 部分 ,循环此操作,则可得 1 的计数。 代码 Output 总结 若是负数,则输出补 阅读全文
posted @ 2016-07-28 15:30 ilove 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 简介 heap有查找时间复杂度O(1),查找、插入、删除时间复杂度为O(logN)的特性,STL中heap相关的操作如下: make_heap() push_heap() pop_heap() sort_heap() reverse() 本次着重介绍make_heap() ,根据其创出的堆有大小堆之 阅读全文
posted @ 2016-07-28 15:06 ilove 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 问题 Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Exa 阅读全文
posted @ 2016-07-27 15:47 ilove 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 问题 Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer targ 阅读全文
posted @ 2016-07-27 15:08 ilove 阅读(538) 评论(0) 推荐(1) 编辑
摘要: 跟我一起写 Makefile陈皓第一章、概述什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional(专业)的程序员,makefile还是要懂。这就好像现在有这么多的HTML的编辑器,但如... 阅读全文
posted @ 2015-02-02 19:05 ilove 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 简单的说其实要理解C文件与头文件(即.h)有什么不同之处,首先需要弄明白编译器的工作过程,一般说来编译器会做以下几个过程:1.预处理阶段2.词法与语法分析阶段3.编译阶段,首先编译成纯汇编语句,再将之汇编成跟CPU相关的二进制码,生成各个目标文件 (.obj文件)4.连接阶段,将各个目标文件中的各段... 阅读全文
posted @ 2015-01-30 18:05 ilove 阅读(15571) 评论(4) 推荐(4) 编辑
摘要: 转载原文网址:http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html花了很长时间整理的,感觉用起来很方便,共享一下。我的vim配置主要有以下优点:1.按F5可以直接编译并执行C、C++、java代码以及执行shell脚本,按“F8”... 阅读全文
posted @ 2015-01-09 17:16 ilove 阅读(215) 评论(0) 推荐(0) 编辑