![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
蜗牛的代码
文章平均质量分 75
snailbreak
这个作者很懒,什么都没留下…
展开
-
Hash表(拉链法)
//拉链法建立hash表//hash.h#ifndef Hash_H#define Hash_H#include using namespace std;struct node{ node():next(NULL){} string value; node* next;};typedef node* HashNode;const int MULT = 31;const int TA原创 2006-03-10 18:59:00 · 2865 阅读 · 1 评论 -
简易电梯模拟程序
问题描述:公司要建立一幢两层的办公大楼并装上“最新”的电梯。公司要求开发一个面向对象的软件模拟程序,仿真电梯的操作,确定这个电梯能否满足需要。 这个电梯只限乘载一人,为了省电,只在需要时才使用,电梯每天在一楼关门等待。模拟程序包括一个时钟,每天从时间0开始,每秒滴答一次。模拟程序的调度器组件随机设置每一层第一个人到来的时间。当时钟的时间等于第一个人到来的时间时,模拟程序对指定层生成一个新到的人并将原创 2006-10-16 17:43:00 · 4146 阅读 · 1 评论 -
简易远程遥控程序
实现:基于winsock TCP,文件传输协议是自定义的功能:客户端命令:hello,root,dir,get,put,exec,del,shutdown服务器返回:HELLO 返回主机名OK;root 返回主机所有分区dir [path]返回主机[path]所有文件名get [path] 下载主机[path]文件put [path] 将客户端[path]文件上传到Serverdel [p原创 2006-10-16 18:27:00 · 1448 阅读 · 0 评论 -
JAVA 实现容器源码
import java.util.*;public class XYObjArray{ int m_nSize; int m_nGrowBy; int m_nSort; Object[] m_pObj; public static int nSearchThreshold = 8; public static int nSortThreshold = 8; static Random ra转载 2006-03-03 12:38:00 · 742 阅读 · 0 评论 -
C++实现通讯录管理程序
// person_info.h: interface for the person_info class.////////////////////////////////////////////////////////////////////////#if !defined(AFX_PERSON_INFO_H__8E4305E3_3140_483E_80C7_234281FF3F9B__IN原创 2006-03-02 18:06:00 · 3398 阅读 · 1 评论 -
设计模式之singleton
#include using std::cout;using std::endl;class Singleton{public: static Singleton& getInstance();//返回引用类型,避免产生对象副本,提高效率 ~Singleton();private: Singleton(); static Singleton* state; static int count原创 2006-03-21 12:26:00 · 788 阅读 · 0 评论 -
循环链表
//CircList.h#ifndef CIRCLIST_H#define CIRCLIST_Hclass ListNode{ friend class CircList;public:// ListNode* next() const{ return link; }// int get_data() const { return data; } ListNode(int d=0,ListNo原创 2006-03-21 12:33:00 · 1007 阅读 · 0 评论 -
C++递归实现欧几里德(Euclid)算法
/* the algorithm of Euclid */#include int gcd(int,int);//the function of Greatest Common Divisor/***************************************************** *example: * gcd(18,12) = gcd(12,18 mod 12)原创 2006-03-09 12:20:00 · 1575 阅读 · 0 评论 -
一个满有技巧性的排序算法
//有1,2,....一直到n的无序数组,求排序算法,并且要求时间复杂度为O(n),//空间复杂度O(1),使用交换,而且一次只能交换两个数.#include#include#includeint print( int*, int );int swap( int&, int& );int main(){ srand((unsigned)time(0)); int *a, n, i,j; sca转载 2006-03-10 19:08:00 · 951 阅读 · 0 评论 -
DooDle(涂鸦)画图程序(C++课题设计)
程序运行界面:1.2. 设计概要:1 引言 1.1编写目的 对C++学习收获的一次测试,以及对自己学习能力的一中考验。1.2背景 说明: a.软件名称:涂鸦(DooDle); b.此画图软件由Bring.Zhang独立完成设计与实现。1.3定义 此画图软件定义了自己的文件存储格式*.dle,只能打开.dle格式的文件1.4参考资料 a. 《Visual C+原创 2006-10-16 16:18:00 · 4978 阅读 · 4 评论