搜索资源列表
int dfsSweep
- 深度搜索算法,求解从起源点s到点j的最短路径算法的基本过程-depth search algorithm, solved from the point of origin j s close of the shortest path algorithm for the basic process
finish01
- 一般来说用int型变量超过2^31的数就会溢出。此程序是利用数组对长度很长的整形字符串进行加减操作,并且进行自动测试的例子-int type generally used more than two variables ^ 31 a few will overflow. This procedure is the use of an array of very long length of plastic strings Modified operation, as well as automa
cmoban
- 参照栈类模板的例子编写一个队列类模板class <T> Queue,私有成员包括:队首指针Front,队尾指针Tail,队列容积max。实现:构造函数Queue,析构函数,入队函数In,出队函数Out(每次出队,后面的元素自动前移一位),判队列空函数Empty。并分别用队列类模板定义int和float对象,调用各个成员函数-reference stack class template examples of the preparation of a class template cl
Expression-D.S.Report2
- 数据结构课程设计报告,算术表达式求值,自动辨别算符优先级,括号,将char型转换成int计算,再将结果显示,具有精美用户界面-data structure curriculum design, arithmetic expression evaluates automatically identify operator precedence, in brackets, char to int conversion type, the result shows that the user inte
sushudui
- 编制函数prime,用来判断整数n是否为素数:bool prime(int n); 而后编制主函数,任意输入一个大于4的偶数n,找出满足n=i+j的所有数对,其中要求i与j均为素数(通过调用prime来判断素数)。如偶数18可以分解为11+7以及13+5;而偶数80可以分解为:43+37、61+19、67+13、73+7。-establishment prime function, used to judge whether the integer n is prime : bool prime
riqi
- 自定义一个简单的日期类DateType,它具有数据成员y、m、d,用来表示当前日期的年、月、日。而后设计该类欲实现(完成)的功能,进而设计出相应的类成员函数。 例如,下面给出的“雏形”可用来实现对天的增加,比较两个日期是否相等,以及对日期的输出等操作。请完成各类成员函数,并编制主函数,说明DateType类对象,对定义的各成员函数进行调用,以验证它们的正确性。 class DateType { //自定义的日期类DateType int y,m,d //数
chazhao
- [问题描述] 在二叉排序树中查找关键字为KEY的记录 [输入] 有序表输入要查找元素的关键字 [输出] 查找成功是即可显示查找成功 #include <stdlib.h> #include <stdio.h> typedef int KeyType typedef struct{ -[Problem Descr iption] Binary Tree ranking keyword search for the rec
neipaixu
- [问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N) [输入] 待排序记录个数,各关键字的值。 [输出] 关键字从正负分开,正数在前 [存储结构] 待排序记录顺序存储。 [算法的基本思想] 快速排序算法每次任取一个记录的关键字为标准,将其余记录分为两组将,N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前。 #in
8queen_sc
- #if !defined(AFX_GAQUEEN_H__C26AE0A3_F9B4_426F_A324_B460CC7946CB__INCLUDED_) #define AFX_GAQUEEN_H__C26AE0A3_F9B4_426F_A324_B460CC7946CB__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CGAQueen
Merge2Array
- this package contains two .c files.One file implements the merge of two int arrays.The other one implements the merge of two linkage array.
7MethodsOfQsort
- 快速排序(qsort)在程序开发中的七种用法(VC)。其中列举了对int和char型数组排序、结构和类的一级二级排序等,具体的cmp函数。
c
- c++冒泡排序#include \"stdio.h\" void sort() { int i,count=0,a[20] int k=20 printf(\"please input 20 defferent numbers?\\n\") for(i=0 i<20 i++) scanf(\" %d\\a\",&a[i]) while(count<20) { for(i=0 i<k i++)
Text
- 编程题(15_01.c) 结构 struct student { long num char name[20] int score struct student *next } 链表练习: (1).编写函数struct student * creat(int n),创建一个按学号升序排列的新链表,每个链表中的结点中 的学号、成绩由键盘输入,一共n个节点。 (2).编写函数void print(struct
c
- #include<malloc.h> #include<limits.h> #include<stdio.h> #include<graphics.h> #include<io.h> #include<math.h> #include<process.h> #include<conio.h> #define m 100 #define OK 1 typedef
INT
- 算法分析ACM题目:整数划分算法 保证能运行!算法分析课程必备!
p11566
- 编写一个冒泡排序的模板,并利用它分别对int型和字符数据进行排序
InOutData
- 此程序对网路传输数据的传输是个很好的东东,其主要是对数据进行压入和压出作了封装, 对int,long,byte,char*和结构均支持, 数据是以流的形式-this procedure to the Internet to transmit data transmission is a very good Eastern, mainly for data indentation made and squeezed out the package, the right int, long, byt
白噪声随机数的产生
- #include<stdio.h> #include<stdlib.h> #include<math.h> #define E 6 #define D 1 double N() { double n=0;int i; for(i=0;i<12;i++) n+=(double)rand()/RAND_MAX; n=(n-E)/sqrt(D); return n; } void main() {
利用复数的输出方法将结果输出
- 1. 定义一个复数类Complex,该类有代表实部与虚部的成员变量,有两个构造函数Complex()与Complex(int x,int y)分别完成将成员变量初始化为0及给定值,另有计算复数的加减法及输出复数的三个方法,编程序利用该类完成2+3i与6-8i相加,12+9i与20-8i相减,并利用复数的输出方法将结果输出。,Define a complex number class Complex, the class is represented real and imaginary part
CPP1 顺序表的基本操作实现实验
- 一、顺序表的基本操作实现实验 要求:数据元素类型ElemType取整型int。按照顺序存储结构实现如下算法: 1)创建任意整数线性表(即线性表的元素值随机在键盘上输入)的顺序存储结构(即顺序表),长度限定在25之内; 2)打印/显示(遍历)该线性表(依次打印/显示出表中元素值); 3)在顺序表中查找第i个元素,并返回其值; 4)在顺序表第i个元素之前插入一已知元素; 5)在顺序表中删除第i个元素; 6)求顺序表中所有元素值(整数)之和; 二、链表(