- 博客(9)
- 资源 (3)
- 收藏
- 关注
原创 ACM-数据结构-树状数组I
ACM竞赛中,树状数组,即二分索引树(BinaryIndexedTree,BIT),也是常见的一种数据结构,其应用场景如下:给出一个长度为n的数组(a[1]-a[n]),每一次给出一个i,询问该数组的前缀和sum[i]。一般情况下,可以在O(n)时间复杂度内处理出所有的前缀和,在O(1)时间复杂度内回答询问。但是如果还存在修改操作,比如修改数组中的某一个元素的值,就无法保证只进行一次O(n)时
2015-07-13 08:27:43 801
原创 网络-WinSocket-I/O模型
WinSocket下编程,总共有7种套接字I/O模型可供选择,分别是阻塞(block)、非阻塞(nonblock)、选择(I/O复用)(select)、异步选择(WSAAsyncSelect)、事件选择(WSAEventSelect)、重叠I/O(Overlapped )以及完成端口(CompletionPort)模型。其中,默认情况下使用WinSocket进行编程,都属于阻塞模型,详细编程过
2015-07-12 10:03:23 974
原创 网络-WinSocket-socket编程
在windows平台下进行socket编程,其实有一些步骤是固定不变的,只要遵循这些流程就不会被那些繁琐的网络API、数据结构弄晕。这里就以WinSocket中的TCP通信为例,编写一个客户端,向服务器发送一个消息,编写一个服务器端,向客户端反射一个消息,以此对详细的编程步骤进行说明。一、服务器端1、首先配置好WinSocket编程环境,如引用头文件、链接静态库等#incl
2015-07-11 18:19:33 1587
原创 ACM-数据结构-并查集
ACM竞赛中,并查集(DisjointSets)这个数据结构经常使用。顾名思义,并查集即表示集合,并且支持快速查找、合并操作。并查集如何表示一个集合?它借助树的思想,将一个集合看成一棵有根树。那又如何表示一棵树?初始状态下,一个元素即一棵树,根即是元素本身。并查集如何支持合并操作?不难发现,按照树的思想,在同一棵树中的所有元素,根都是相同的。也就是说,合并两个不同的集合,只需要将其
2015-07-10 20:53:27 2924
原创 ACM-数据结构总览
ACM竞赛,谈到程序中数据的组织方式,那就不得不涉及到各种数据结构,这里将一些经典的数据结构整理出来:并查集-用树来表示集合,支持快速查找、合并,数据结构-并查集()
2015-07-10 18:48:34 1824
Introduction to 3D Game Programming with DirectX 11
2017-08-29
windows下7种winsocket的I/O编程模型
2015-07-19
WinSocket编程
2015-07-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人