C++
文章平均质量分 65
ZQ_onlytime
这个作者很懒,什么都没留下…
展开
-
C++基础总结(C++ Primer 回顾)
变量和基本类型基本内置类型原创 2014-09-22 09:57:36 · 459 阅读 · 0 评论 -
面试数据结构之---链表
面试精选:链表问题集锦文章目录1. 在O(1)时间删除链表节点2. 单链表的转置3. 求链表倒数第k个节点4. 求链表的中间节点5. 判断单链表是否存在环6. 找到环的入口点7. 编程判断两个链表是否相交8. 扩展:链表有环,如何判断相交9. 扩展:两链表相交的第一个公共节点10. 总结参考文献链表问题在面试过程中也是很重要也很基础的一部分,链表本身很灵活,很考查编程功转载 2014-10-22 22:02:29 · 649 阅读 · 0 评论 -
.hpp文件详解
hpp简介:hpp原创 2014-10-30 09:16:51 · 1756 阅读 · 0 评论 -
Protobuf语言指南
Protobuf语言指南l 定义一个消息(message)类型l 标量值类型l Optional 的字段及默认值l 枚举l 使用其他消息类型l 嵌套类型l 更新一个消息类型l 扩展l 包(package)l 定义服务(service)l 选项(option)l 生成访问类转载 2014-10-30 23:38:10 · 484 阅读 · 0 评论 -
C++引用报错:invalid initialization of non-const reference of type ‘std::string&’ from an rvalue of type
参考: http://blog.csdn.net/zhenwo123/article/details/8031155invalid initialization of non-const reference of type ‘std::string&’ from an rvalue of type ‘std::string’#include#includeusing std::转载 2015-03-26 19:52:07 · 21070 阅读 · 1 评论 -
大端和小端(Big endian and Little endian)
一、大端和小端的问题对于整型、长整型等数据类型,Big endian 认为第一个字节是最高位字节(按照从低地址到高地址的顺序存放数据的高位字节到低位字节);而 Little endian 则相反,它认为第一个字节是最低位字节(按照从低地址到高地址的顺序存放据的低位字节到高位字节)。例如,假设从内存地址 0x0000 开始有以下数据: 0x0000 0x0001转载 2015-04-06 13:56:42 · 581 阅读 · 0 评论 -
C++的cin/cout为什么比C语言的scanf/printf慢
很早就知道,c的scanf(printf)比c++的快。刷题时尤其明显,在这上面超时是常有的事儿。但,这是别人告诉我的,c快。为什么快?从网上借鉴一个例子做个简单测试:1.cpp //向一个文件里输入1000000个随机数#include#include#includeusing namespace std;const int num=1转载 2015-04-06 10:35:51 · 6568 阅读 · 1 评论 -
Clone Graph BFS & DFS
变量unordered_map cloneMap;因为会有环,所以需要cloneMap记录旧的节点和新的节点对。还需要一个visited记录已经访问过的节点,可以和cloneMap合并在一起。DFS:在克隆某个Node时,首先放入map中。之后遍历neighbors。如果neighbors不在map里,即没有访问过,则递归调用cloneGraph转载 2015-04-07 17:00:24 · 577 阅读 · 0 评论 -
Kth Smallest Number in Multiplication Table
# Kth Smallest Number in Multiplication TableNearly every one have used the Multiplication Table. But could you find out the k-th smallest number quickly from the multiplication table?Given the height原创 2017-10-25 22:42:21 · 387 阅读 · 0 评论