上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: void QuickSort::QuickSort_Sort(int low,int high){ int Pivot_Key=Int_Vector[low],i=low,j=high; while(i<j) { while(i<j&&Int_Vector[j]>=Pivot_Key) { j--; } if(i<j) { Swap_Value(I... 阅读全文
posted @ 2009-09-19 05:39 AlexusLi 阅读(957) 评论(0) 推荐(0) 编辑
摘要: #include "StdAfx.h"#include "HeapSort.h"void Swap_Value(int &lhs,int &rhs);HeapSort::HeapSort(void){}HeapSort::~HeapSort(void){}void HeapSort::Heap_Sort_Init(std::vector<int> _Int_Vector... 阅读全文
posted @ 2009-09-19 05:38 AlexusLi 阅读(1364) 评论(0) 推荐(0) 编辑
摘要: #include "StdAfx.h"#include "MergeSort.h"typedef vector<int> IntDefVector;MergeSort::MergeSort(void){}MergeSort::~MergeSort(void){}void MergeSort::MergeSort_Ini(std::vector<int> _Int_Vecto... 阅读全文
posted @ 2009-09-19 05:37 AlexusLi 阅读(369) 评论(0) 推荐(0) 编辑
摘要: from:http://www.cnblogs.com/architect/archive/2009/05/06/1450489.html//归并排序中之并//Updatedbyzivsoftat05/06/2009int*Merge(int*a,intaLength,int*b,intbLength){//合并结果指针int*result;//初始化结果指针result=newint[aLeng... 阅读全文
posted @ 2009-09-19 04:58 AlexusLi 阅读(520) 评论(0) 推荐(0) 编辑
摘要: #include "StdAfx.h"#include "Insert_Sort.h"Insert_Sort::Insert_Sort(vector<int> _Vector,int _Size){ //assign the value to the private member for(int i=0;i<_Size-1;i++) { IntVector.push_back(... 阅读全文
posted @ 2009-09-17 15:35 AlexusLi 阅读(443) 评论(1) 推荐(0) 编辑
摘要: 服务器端程序: 1. 创建套接字(socket); 2. 将套接字绑定到一个本地地址和端口上(bind); 3. 将套接字设为监听模式,准备接收客户端请求(listen); 4. 等待客户端请求,当请求到达后,接受连接请求,返回一个新的对应于此次连接的套接字(accept); 5. 用返回的套接字和客户端进行通信(send/recv); 6. 返回,等待另一客户请求; 7. 关闭套接字; 客户端程... 阅读全文
posted @ 2009-09-16 19:46 AlexusLi 阅读(1971) 评论(1) 推荐(0) 编辑
摘要: 目标: 成为合格的Linux平台C语言程序员 技能: 掌握C语言基本语法,掌握Linux平台系统调用,熟悉Linux平台开发流程,掌握anjuta以及glade使用方法,了解kernel结构编写高质量程序。 步骤: 1、学习C语言语法 预计时间:30天 参考书籍 http://man.lupaworld.com/content/develop/c&c++/c/C_program_lan... 阅读全文
posted @ 2009-09-14 16:16 AlexusLi 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 同步:函数没有执行完不返回,线程被挂起 阻塞:没有收完数据函数不返回,线程也被挂起 异步:函数立即返回,通过事件或是信号通知调用者 非阻塞:函数立即返回,通过select通知调用者同步  所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不返回。按照这个定义,其 实绝大多数函数都是同步调用(例如sin, isdigit等)。但是一般而言,我们在说同步、异步的时候,特指那些需要其他部... 阅读全文
posted @ 2009-09-13 16:21 AlexusLi 阅读(244) 评论(0) 推荐(0) 编辑
摘要: // GetHostIpAdd.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <stdio.h>#include <Winsock2.h>int _tmain(int argc, _TCHAR* argv[]){ //////////////// // Initialize windows sockets API. As... 阅读全文
posted @ 2009-09-13 08:32 AlexusLi 阅读(706) 评论(0) 推荐(0) 编辑
摘要: 与socket有关的一些函数介绍 1、读取当前错误值:每次发生错误时,如果要对具体问题进行处理,那么就应该调用这个函数取得错误代码。 int WSAGetLastError(void ); #define h_errno WSAGetLastError() 错误值请自己阅读Winsock2.h。 2、将主机的unsigned long值转换为网络字节顺序(32位):为什么要这样做呢?因为不同的计... 阅读全文
posted @ 2009-09-12 04:16 AlexusLi 阅读(202) 评论(1) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页