摘要: heap并不属于STL容器组件,它分为 max heap 和min heap,在缺省情况下,max-heap是优先队列(priority queue)的底层实现机制。 而这个实现机制中的max-heap实际上是以一个vector表现的完全二叉树(complete binary tree)。 二叉堆( 阅读全文
posted @ 2017-02-04 14:28 扫地猿 阅读(3306) 评论(0) 推荐(0) 编辑
摘要: 功能描述:根据文件描述词来操作文件的特性。 文件控制函数 fcntl -- file control头文件: #include <unistd.h> #include <fcntl.h> 函数原型: int fcntl(int fd, int cmd); int fcntl(int fd, int 阅读全文
posted @ 2017-02-04 09:31 扫地猿 阅读(1655) 评论(0) 推荐(0) 编辑
摘要: 1.closesocket(一般不会立即关闭而经历TIME_WAIT的过程)后想继续重用该socket:BOOL bReuseaddr=TRUE;setsockopt(s,SOL_SOCKET ,SO_REUSEADDR,(const char*)&bReuseaddr,sizeof(BOOL)); 阅读全文
posted @ 2017-02-04 09:14 扫地猿 阅读(3693) 评论(0) 推荐(0) 编辑