虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

Int

  • 哈夫曼树和哈夫曼编码: 从终端输入若干个字符及其对应的整数

    哈夫曼树和哈夫曼编码: 从终端输入若干个字符及其对应的整数,将整数作为结点的权值,建立哈夫曼树,然后对各字符进行哈夫曼编码。最后打印哈夫曼树和对应的哈夫曼编码。 设计要求: ⑴ 哈夫曼殊和哈夫曼编码的存储表示参考教材事例 ⑵ 在程序中构造四个子程序为 ① Int createhtree(HTree *t) /*根据输入的字符及其权值建立哈夫曼树*/ ② void coding(HTree *t, char *code) /*对哈夫曼树进行编码*/ ③ void prInthtree(HTree *t, Int* path) /*中序打印树*/ ④ void prIntcode(HTree *t) /*输出个字符的哈夫曼编码*/

    标签: 字符 整数 编码

    上传时间: 2013-12-17

    上传用户:二驱蚊器

  • [输入] 图的顶点个数N

    [输入] 图的顶点个数N,图中顶点之间的关系及起点A和终点B [输出] 若A到B无路径,则输出“There is no path” 否则输出A到B路径上个顶点 [存储结构] 图采用邻接矩阵的方式存储。 [算法的基本思想] 采用广度优先搜索的方法,从顶点A开始,依次访问与A邻接的顶点VA1,VA2,...,VAK, 访问遍之后,若没有访问B,则继续访问与VA1邻接的顶点VA11,VA12,...,VA1M,再访问与VA2邻接顶点...,如此下去,直至找到B,最先到达B点的路径,一定是边数最少的路径。实现时采用队列记录被访问过的顶点。每次访问与队头顶点相邻接的顶点,然后将队头顶点从队列中删去。若队空,则说明到不存在通路。在访问顶点过程中,每次把当前顶点的序号作为与其邻接的未访问的顶点的前驱顶点记录下来,以便输出时回溯。 #include<stdio.h> Int number //队列类型 typedef struct{ Int q[20]

    标签: 输入

    上传时间: 2015-11-16

    上传用户:ma1301115706

  • [问题描述] 在二叉排序树中查找关键字为KEY的记录 [输入] 有序表输入要查找元素的关键字 [输出] 查找成功是即可显示查找成功 #include <stdlib.h> #

    [问题描述] 在二叉排序树中查找关键字为KEY的记录 [输入] 有序表输入要查找元素的关键字 [输出] 查找成功是即可显示查找成功 #include <stdlib.h> #include <stdio.h> typedef Int KeyType typedef struct{

    标签: include stdlib KEY 输入

    上传时间: 2015-11-16

    上传用户:erkuizhang

  • [问题描述] 将N个关键字去整数的记录进行整序

    [问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N) [输入] 待排序记录个数,各关键字的值。 [输出] 关键字从正负分开,正数在前 [存储结构] 待排序记录顺序存储。 [算法的基本思想] 快速排序算法每次任取一个记录的关键字为标准,将其余记录分为两组将,N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前。 #include <iostream> using namespace std #define MAXNUM 100//设文件的最长可能长度 void sort(Int* keys, const Int len)//排序

    标签: 整数 记录

    上传时间: 2014-01-13

    上传用户:aig85

  • (1) 给定一段符合Pascal子集语法的语言

    (1) 给定一段符合Pascal子集语法的语言,能成功转换成C语言; (2) 一个简单的说明文档; (3) 2007.7.14之前上传到ftp:// C07:C07@10.11.3.71/upload,用学号建立自己的目录; (4) (可额外加分5分)若有出错处理功能,请在说明文档中写明可以处理哪几项错误。 注意事项: (1) 两人一组 (2) 可以使用词法、语法自动生成工具,windows下有Flex,Bison,Linux下有Lex,Yacc,Java的有Jlex,JavaCC,ANTLR等 (3) 不用考虑Pascal和C的关键词不同问题,即Pascal子集语言中假设不出现Int,for等作为变量标志符 (4) read()和write()可用由scanf(),prIntf()等组成的语句转换。 (5) 如果有疑问可以发信给我 xpqiu@fudan.edu.cn.

    标签: Pascal 语言

    上传时间: 2015-11-20

    上传用户:talenthn

  • 移动平均预测 ModifyShiftAverageRegress.cs 移动平均也可画趋势图

    移动平均预测 ModifyShiftAverageRegress.cs 移动平均也可画趋势图,如下: public double forecast(Int Interval) 移动平均认为数据是时间序列数据,该方法预测Interval个时间间隔后的值 public override double[] getTrendArray() 得到趋势数组,该数组的数据直接在图形中展示出来就可以产生趋势线。

    标签: ModifyShiftAverageRegress 移动 cs

    上传时间: 2014-01-01

    上传用户:wff

  • 显示数据处理(拆数字).mcu控制LCD显示数字时的拆数程序

    显示数据处理(拆数字).mcu控制LCD显示数字时的拆数程序,可拆Int型整数和float型浮点数,所拆数存放于全局变量 数组中。

    标签: mcu LCD 数字 显示数据

    上传时间: 2013-12-27

    上传用户:kikye

  • UC Library Extensions UnderC comes with a pocket implementation of the standard C++ libraries, wh

    UC Library Extensions UnderC comes with a pocket implementation of the standard C++ libraries, which is a reasonably faithful subset. This documentation describes those UnderC functions and classes which are not part of the C++ standard. UC Library Builtin functions: Most of these are standard C functions, but there are a few unique to the UnderC system which give you runtime access to the compiler. You may evaluate expressions, execute commands, compile code, etc. * Expands the text in expr using the UnderC preprocessor, putting the result Into buff. void uc_macro_subst(const char* expr, char* buff, Int buffsize) * Executes a UC #-command, like #l or #help. uc_cmd() expects the name of the command, _without_ the hash, e.g. uc_cmd("l fred.cpp") or uc_cmd("help"). void uc_cmd(const char* cmd) * Evaluates any C++ expression or statement will return non-zero if unsuccessful.

    标签: implementation Extensions libraries standard

    上传时间: 2013-12-14

    上传用户:leehom61

  • #ifdef _AFXDLL Enable3dControls() // Call this when using MFC in a shared DLL #else Enable3d

    #ifdef _AFXDLL Enable3dControls() // Call this when using MFC in a shared DLL #else Enable3dControlsStatic() // Call this when linking to MFC statically #endif CPreviewDialogDlg dlg m_pMainWnd = &dlg Int nResponse = dlg.DoModal() if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application s message pump. return FALSE }

    标签: Enable3dControls Enable3d AFXDLL shared

    上传时间: 2015-12-19

    上传用户:hustfanenze

  • #if !defined(AFX_GAQUEEN_H__C26AE0A3_F9B4_426F_A324_B460CC7946CB__INCLUDED_) #define AFX_GAQUEEN_H_

    #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 { public: CGAQueen(Int nPopulation,Int nIteration,float Mutation,Int mChBoard) virtual ~CGAQueen() void Clear() // to clear chess board with 0 value void InitialPopulation() // to create the first and initial randompopulation void FillArea(Int index) // to fill chess board with desired chromosome Int CostFunc(Int index) // determine the cost of matrix[index][index] void PopulationSort() // to sort population from the best to the worst void GenerateCrossOverMatrix() // a way to create children from parent is CcrossOver void Mating() // to create children from parents void Ap

    标签: AFX_GAQUEEN_H INCLUDED defined define

    上传时间: 2015-12-27

    上传用户:wuyuying