CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - h.3
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
Compress-Decompress algrithms
STL
Data structs
Algorithm
AI-NN-PR
matlab
Bio-Recognize
Crypt_Decrypt algrithms
mathematica
Maple
DataMining
Big Data
comsol
physical calculation
chemical calculation
simulation modeling
Search - h.3 - List
[
Data structs
]
grap
DL : 0
—图数据类型的实现——问题描述:图是一种较线性表和树更为复杂的数据结构。在图形结构中,结点之间的关系是任意的,任意两个数据元素之间都可能相关,因此,图的应用非常广泛,已渗入到诸如语言学‘逻辑学、物理、化学、电讯工程、计算机科学及数学的其它分支中。因此,实现图这种数据类型也尤为重要,在该练习中即要实现图的抽象数据类型。基本要求:2、 定义出图的ADT;3、 采用邻接矩阵及邻接表的存储结构(有向图也可使用十字链表)实现以下操作:a. 构造图 b. 销毁图 c. 定位操作d. 访问图中某个顶点的操作e. 给图中某个顶点赋值的操作f. 找图中某个顶点的第一个邻接点g. 找出图G中顶点v相对于w的下一个邻接点h. 在图G中添加新顶点vi. 删除图G中顶点vj. 在图G中插入一条边k. 在图G中删除一条边l. 实现图的深度遍历操作m. 实现图的广度遍历操作参考提示:具体内容参看教科书本156页实验要求:对于以上具体操作要求实现时有良好的用户交互界面。详细设计、编码、测试。-2 ADT3 a. b. c. d. e. f. g. Gvwh. Gvi. Gvj. Gk. Gl. m.
Date
: 2025-12-16
Size
: 2kb
User
:
水寒
[
Data structs
]
shellsort111
DL : 1
附有本人超级详细解释(看不懂的面壁十天!) 一、 实际问题: 希尔排序(Shell Sort)是插入排序的一种。因D.L.Shell于1959年提出而得名。它又称“缩小增量分类法”,在时间效率上比插入、比较、冒泡等排序算法有了较大改进。能对无序序列按一定规律进行排序。 二、数学模型: 先取一个小于n的整数d1作为第一个增量,把文件的全部记录分成d1个组。所有距离为dl的倍数的记录放在同一个组中。先在各组内进行直接插人排序;然后,取第二个增量d2<d1重复上述的分组和排序,直至所取的增量dt=1(dt<dt-l<…<d2<d1),即所有记录放在同一组中进行直接插入排序为止。该方法实质上是一种分组插入方法。 三、算法设计: 1、将相隔某个增量dlta[k]的元素构成一个子序列。在排序过程中,逐次减小这个增量,最后当h减到1时,进行一次插入排序,排序就完成。增量序列一般采用:dlta[k]=2t-k+1-1,其中t为排序趟数,1≤k≤t≤[log2 (n+1)],其中n为待排序序列的长度。按增量序列dlta[0..t-1]。 2、按增量dlta[k](1≤k≤t≤[log2 (n+1)])进行一趟希尔插入排序。 3、在主函数中控制程序执行流程。 4、时间复杂度:1≤k≤t≤[log2 (n+1)]时为O(n3/2)。 -with super detailed explanation (not read the Wall for 10 days!) A practical question : Sort Hill (Shell Sort) is inserted into a sort. By D. L. Shell made in 1959 and named after. It is also known as the "narrow incremental method" in the time-efficient than inserted, such as sorting algorithms and bubbling there has been a big improvement. The disorder can sequence by law must rank. Two mathematical models : first getting a less than n integers d1 as an increment. all documents should be recorded into d1 groups. All distance dl in multiples of record on the same group. In the first group for direct insertion sorting; Then, take a second increment d2
Date
: 2025-12-16
Size
: 19kb
User
:
乐乐
[
Data structs
]
TriMat
DL : 0
在目录“\上三角矩阵类的实现”中给定了文件triMat.cpp、triMat.h,请把triMat.h文件中的9个填空位置补上正确的代码,使triMat.cpp能完成上三角矩阵的加、减、乘运算。要求输入: 输入矩阵维数:4 输入矩阵a的元素(包括0): 1 2 3 4 0 1 2 3 0 0 1 2 0 0 0 1 输入矩阵b的元素(包括0): 1 2 3 4 0 1 2 3 0 0 1 2 0 0 0 1 -in the directory "\ triangular matrices on the achievement," given the document triMat.cpp. triMat.h invited to triMat.h documents fill up the nine positions make up the correct code, so triMat.cpp complete triangular matrix on the addition, subtraction, multiplication. Importation : input matrix dimension : a four input matrix elements (including 0) : 1 2 3 4 0 1 2 3 0 0 1 2 0 0 0 1 b of the input matrix elements (including 0) : 1 2 3 4 0 1 2 3 0 0 1 2 0 0 0 1
Date
: 2025-12-16
Size
: 572kb
User
:
李昭明
[
Data structs
]
tushendu
DL : 0
图的深度遍历,输出结果为(红色为键盘输入的数据,权值都置为1): 输入顶点数和弧数:8 9 输入8个顶点. 输入顶点0:a 输入顶点1:b 输入顶点2:c 输入顶点3:d 输入顶点4:e 输入顶点5:f 输入顶点6:g 输入顶点7:h 输入9条弧. 输入弧0:a b 1 输入弧1:b d 1 输入弧2:b e 1 输入弧3:d h 1 输入弧4:e h 1 输入弧5:a c 1 输入弧6:c f 1 输入弧7:c g 1 输入弧8:f g 1 深度优先遍历: a b d h e c f g 程序结束. -Traverse the depth chart, the output results (red for the keyboard input data, weights are set to 1): Enter the number of Vertices and arcs: 8 9 input vertex 8. Input vertex 0: a input vertex 1: b input Vertex 2: c input vertex 3: d input vertex 4: e input vertex 5: f input vertex 6: g Enter the Vertex 7: h input arc 9. input arc 0: ab 1 input arc 1: bd 1 input arc 2: be 1 input arc 3: dh 1 input arc 4: eh 1 input arc 5: ac 1 input arc 6: cf 1 input arc 7: cg 1 input arc 8: fg 1 depth-first traversal: abdhecfg end of the process.
Date
: 2025-12-16
Size
: 1kb
User
:
Louis
[
Data structs
]
Data_Structures_and_Algorithm_Analysis_in_C++_(3rd
DL : 0
经典书籍源代码啊。。。第三版。。。数据结构与算法分析——C++描述(第3版).-Ah classic books source code. . . Third edition. . . Data Structure and Algorithm Analysis- C++ Description (3rd edition).
Date
: 2025-12-16
Size
: 78kb
User
:
unsin
[
Data structs
]
huffman
DL : 0
实现最优二叉树的构造;在此基础上完成哈夫曼编码器与译码器。 假设报文中只会出现如下表所示的字符: 字符 A B C D E F G H I J K L M N 频度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57 字符 O P Q R S T U V W X Y Z , . 频度 63 15 1 48 51 80 23 8 18 1 16 1 6 2 要求完成的系统应具备如下的功能: 1.初始化。从终端(文件)读入字符集的数据信息,。建立哈夫曼树。 2.编码:利用已建好的哈夫曼树对明文文件进行编码,并存入目标文件(哈夫曼码文件)。 3.译码:利用已建好的哈夫曼树对目标文件(哈夫曼码文件)进行编码,并存入指定的明文文件。 4.输出哈夫曼编码文件:输出每一个字符的哈夫曼编码。
Date
: 2025-12-16
Size
: 129kb
User
:
张娟
[
Data structs
]
Employee
DL : 0
数据结构课程第一次实验 要求:1.基类和派生类的定义和实现(.h .cpp) 2.+ 运算符重载 3.<< 运算符重载 4.构造与重载函数应用-Data structure course first experiment requirements: 1. Base class and derived class definition and realize (. H. Cpp) 2.+ Operator overloading 3.
Date
: 2025-12-16
Size
: 8kb
User
:
Lado & Vogiss
[
Data structs
]
Untitled1
DL : 0
【问题描述】 设计一个利用哈夫曼算法的编码和译码系统,重复地显示并处理以下项目,直到选择退出为止。 【基本要求】 (1)初始化:键盘输入字符集大小n、n个字符和n个权值,建立哈夫曼树; (2)编码:利用建好的哈夫曼树生成哈夫曼编码; (3)输出编码; (4)设字符集及频度如下表: 字符:A B C D E F 频度:4 9 23 2 17 15 字符:G H I J K 频度:1 2 3 3 4 -【Description】 design a question of the use of Huffman coding and decoding algorithm system, repeat the show and deal with the following items until the opt-out so far. The basic requirements 【】 (1) Initialization: keyboard input character set size of n, n and n characters of the right value, set up Huffman tree (2) Coding: Using the built Huffman Huffman tree generated coding (3) the output coding (4) based character set and the frequency of the following table: characters: ABCDEF frequency: 492,321,715 characters: GHIJK frequency: 12,334
Date
: 2025-12-16
Size
: 1kb
User
:
Fiona
[
Data structs
]
yueshefuhuanwenti
DL : 0
设计求解约瑟夫环问题的出列顺序。具体的要求和说明如下: (1)利用单向循环链表存储结构模拟此过程,按照出列的顺序输出个人的编号。 (2)m的初值为20;n=7,7个人的密码依次为:3,1,7,2,4,8,4,首先m的值为6(正确的出列顺序应为:6,1,4,7,2,3,5)。 (3)程序运行后,首先要求用户指定初始报数的上限值,然后读取个人的密码。可设n<=30,此题所用的循环链表中不需要“头结点”,请注意空表和非空表的界限。 (4)将上述功能改为在顺序结构上实现。-#include<stdio.h> #include<stdlib.h> #define MAX_NODE_NUM 30 #define TRUE 1U #define FALSE 0U typedef struct NodeType { int id /*
Date
: 2025-12-16
Size
: 2kb
User
:
chen
[
Data structs
]
Haffmancode
DL : 0
课程设计: 1.求出在一个n×n的棋盘上,放置n个不能互相捕捉的国际象棋“皇后”的所有布局。 2.设计一个利用哈夫曼算法的编码和译码系统,重复地显示并处理以下项目,直到选择退出为止。 【基本要求】 1) 将权值数据存放在数据文件(文件名为data.txt,位于执行程序的当前目录中) 2) 分别采用动态和静态存储结构 3) 初始化:键盘输入字符集大小n、n个字符和n个权值,建立哈夫曼树; 4) 编码:利用建好的哈夫曼树生成哈夫曼编码; 5) 输出编码; 6) 设字符集及频度如下表: 字符 空格 A B C D E F G H I J K L M 频度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 字符 N O P Q R S T U V W X Y Z 频度 57 63 15 1 48 51 80 23 8 18 1 16 1 -Curriculum design: 1. Obtained in an n × n chessboard, the place to catch each other should not n个chess "Queen" of all the layout. 2. The design of a use of Huffman coding and decoding algorithms systems, and deal with duplicate to show the following items until the exit date selection. The basic requirements 【】 1) will be the right value data stored in data files (file named data.txt, located in the implementation of procedures in the current directory) 2), respectively, dynamic and static storage structure 3) Initialization: keyboard input character set size of n, n and n characters of the right value, set up Huffman tree 4) Coding: Using the built Huffman tree generated Huffman coding 5) output coding 6) The character set and the frequency of the following table: Space characters A B C D E F G H I J K L M Frequency of 186 64 13 22 32 103 21 15 47 57 1 5 32 20 Character N O P Q R S T U V W X Y Z Frequency 57 63 15 1 48 51 80 23 8 18 1 16 1
Date
: 2025-12-16
Size
: 538kb
User
:
赵刚
[
Data structs
]
magic
DL : 0
将魔王的语言抽象为人类的语言:魔王语言由以下两种规则由人的语言逐步抽象上去的:α-〉β1β2β3…βm ;θδ1δ2…-〉θδnθδn-1…θδ1 设大写字母表示魔王的语言,小写字母表示人的语言B-〉tAdA,A-〉sae,eg:B(ehnxgz)B解释为tsaedsaeezegexenehetsaedsae对应的话是:“天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅”。(t-天d-地s-上a-一只e-鹅z-追g-赶x-下n-蛋h-恨)
Date
: 2025-12-16
Size
: 1kb
User
:
于翔
[
Data structs
]
data_structure1
DL : 0
1、顺序表 Seqlist.h Test.cpp 2、单链表 ListNode.h SingleList.h test.cpp 3、双向链表 NodeList.h DoubleList.h Test.cpp 4、循环链表 ListNode.h CircularList.h Test.cpp -1, the order form Seqlist.h Test.cpp 2, single-chain ListNode.h SingleList.h test.cpp 3, two-way linked list NodeList.h DoubleList.h Test.cpp 4, cycle ListNode.h CircularList.h Test List . cpp
Date
: 2025-12-16
Size
: 3kb
User
:
XS
[
Data structs
]
exp7-1
DL : 0
实现二叉树b的各种运算: 1. 输出二叉树; 2. 输出 H 结点的左·右孩子结点值; 3. 输出二叉树b的深度; 4. 输出二叉树b的宽度; 5. 输出二叉树b的结点个数; 6. 输出二叉树b的叶子结点个数。-Binary Tree b to achieve a variety of computing: 1. Output tree 2. Output the children of node H child nodes around node value 3. Output binary tree of depth b 4. Output tree width b 5. output node of binary tree the number of b 6. output binary tree node b the number of leaves.
Date
: 2025-12-16
Size
: 2kb
User
:
fishle
[
Data structs
]
puke
DL : 0
编号为1-52张牌,正面向上,从第2张开始,以2为基数,是2的倍数的牌翻一次,直到最后一张牌;然后,从第3张开始,以3为基数,是3的倍数的牌翻一次,直到最后一张牌;然后…从第4张开始,以4为基数,是4的倍数的牌翻一次, 直到最后一张牌;...再依次5的倍数的牌翻一次,6的,7的 直到 以52为基数的 翻过,输出:这时正面向上的牌有哪些?-#include "stdio.h" void main() {/*采用数组存储,循环嵌套实现*/ int i,j int a[53] /*定义数组大小*/ for(i=1 i<=52 i++) { a[i]=i /*给出五十二张牌*/ } for(i=1 i<=52 i++)/*循环翻牌*/ for(j=2 j<=52 j++) {if(a[i] j==0) a[i]=a[i]*(-1) /*整除判断*/ } for(i=1 i<=52 i++) if (a[i]>0) printf(" d\n",a[i]) /*输出牌号*/ }
Date
: 2025-12-16
Size
: 2kb
User
:
fang
[
Data structs
]
clock
DL : 0
1. 首先建立一个基本对话的exe工程,并命名为time; 2. 在BOOL CTimeDlg::OnInitDialog()函数内建立一个计时器,SetTimer(1,1000,NULL) 3. 再用classwizard建立消息响应函数void CTimeDlg::OnTimer(UINT nIDEvent),在里面输入代码如下:Invalidate() 4. 再用classwizard建立消息响应函数void CTimeDlg::OnDestroy(),在里面输入代码如下:KillTimer(1) 以此来消除计时器; 5. 在void CTimeDlg::OnPaint()里输入上面的算法; 6. 为CtimeDlg类添加头文件math.h,代码:#include "math.h"。 7. 编译、链接、运行。 -1. First, the establishment of a basic dialogue exe project, and named the time 2. In the BOOL CTimeDlg:: OnInitDialog () function is the establishment of a timer, SetTimer (1,1000, NULL) 3. Then the establishment of the message to respond to classwizard function void CTimeDlg:: OnTimer (UINT nIDEvent), enter the code inside is as follows: Invalidate () 4. then classwizard set-up message response function void CTimeDlg:: OnDestroy (), enter the code inside the following: KillTimer (1) to this to eliminate the timer 5. void CTimeDlg:: OnPaint () where importation of the above algorithm 6. CtimeDlg class to add header file for the math.h, the code:# include " math.h" . 7. Compile, link and run.
Date
: 2025-12-16
Size
: 1.82mb
User
:
tmacq3
[
Data structs
]
aglo7
DL : 0
(一) 编写一个程序LAGO7-1.CPP,实现二叉树的各种运算,并在此基础上设计一个主程序完成如下功能。 (1) 输出二叉树B; (2) 输出二叉树B的深度; (3) 输出H结点的左、右孩子结点值; (4) 输出二叉树B的宽度; (5) 输出二叉树B的结点个数; 输出二叉树B的叶子结点个数 -(A) to prepare a program LAGO7-1.CPP, to achieve a variety of binary operations, and on this basis, design a main program performs the following functions. (1) output binary tree B (2) The output of a binary tree B of depth (3) The output of H nodes left and right child node value (4) outputs a binary tree B, width (5) output node B, the number of binary trees (6) outputs a binary tree B, the number of leaf nodes
Date
: 2025-12-16
Size
: 2kb
User
:
xjj
[
Data structs
]
ds_6
DL : 0
1.定义哈希表数据结构。 2.除留余数法做为哈希函数、 H(key) = key P 用线性探测再散列解决冲突方法,编写函数,实现哈希造表的过程,并输出哈希表。 3.编写函数,求查找成功时的平均查找长度(ASL)。-1. Define hash table data structure. 2. In addition to leaving the remainder as the hash function method, H (key) = key P re-hashing with linear probing methods of conflict resolution, write a function to achieve the hash table making process and output of the hash table. 3. Write function, seeking to find success, the average search length (ASL).
Date
: 2025-12-16
Size
: 1kb
User
:
Yvonne
[
Data structs
]
DLink
DL : 0
1.求双向循环链表的长度 2.在双向循环链表指定位置插入一个元素 3.给定双向循环链表中一个结点元素值e,要求将数据y插入到元素e的前面 4.给定双向循环链表中一个结点元素值e,要求将数据y插入到元素e的后面 5.给定双向循环链表中一个结点元素值e,要求将数据y插入到元素e的后面 6.删除双向循环链表中指定位置的元素 7.给定双向循环链表中一个结点元素值e,要求将其对应结点删除 8.给定双向循环链表中一个结点元素值e,要求删除对应结点的直接前驱 9.给定双向循环链表中一个结点元素值e,要求删除对应结点的直接后继 10.求双向循环链表中第i个元素 11.判断双向循环链表H中是否存在元素x,若存在返回1,否则返回0 12.将双向循环链表L就地逆置 13.将双向循环链表逆序输出 14.求双向循环链表H中结点p的直接前驱 15.求双向循环链表H中结点p的直接后继-1. Seek a two-way circular list the length of the 2. In a two-way circular linked list insert an element in the specified location 3. For a given two-way loop in a linked list node element of the value of e, requires that the data y is inserted into the front element e 4. For a given two-way loop in a linked list node element of the value of e, requires that the data y is inserted into the back of element e 5. For a given two-way loop in a linked list node element of the value of e, requires that the data y is inserted into the back of element e 6. Remove the two-way circular linked list of elements in the specified location 7. For a given two-way loop in a linked list node element of the value of e, request to delete the corresponding nodes 8. For a given two-way loop in a linked list node element of the value of e, to delete the corresponding node immediate precursor 9. For a given two-way loop in a linked list node element of the value of e, to delete the correspondi
Date
: 2025-12-16
Size
: 2kb
User
:
张敏
[
Data structs
]
exam5
DL : 0
1、用随机函数生成10个待排序元素; 2、利用二叉查找树输出升序序列; 3、利用同一棵二叉查找树输出降序序列; 4、写出查找的递归函数;注意:递归出口的处理要求:二叉排序树的程序填空:修改 “BiSearchTree.h” 文件中的myorder()函数,得到二叉排序树的降序序列,要求达到BiSearchTree.exe的执行效果。 哈希查找: 1、 哈希表类的哈希函数采用除留余数法哈希函数; 2、 解决哈希冲突的函数采用开放定址法中的线性探察法。 3、 建立一个由10个数据元素组成的集合; 测试哈希表长度m=13和m=11两种情况下的哈希表,并查找其中的几个元素。
Date
: 2025-12-16
Size
: 200kb
User
:
tamakiramimy
[
Data structs
]
horse
DL : 0
问题描述与实验目的 给定8*8方格棋盘,求棋盘上一只马从一个位置到达另一位置的最短路径长。 注意马是走“日”形的。 输入 输入有若干测试数据。 每组测试数据仅1行,每行上有2个方格pos1、pos2,之间用一个空格隔开,每格方格表示棋盘上的一个位置,该位置由表示列的1个字母(a-h)及表示行的一个数字(1-8)构成,如“d7”表示第4列第7行。 输出 对输入中每行上的2个方格pos1、pos2,输出马从位置pos1跳到pos2所需的最短路径长。如“a1==>a2: 3 moves”表示从位置a1跳到a2所需的最少步数是3。 注意:按输出样例所示格式输出,如“a1==>a2: 3 moves”中冒号后有一个空格,再跟着所需的最少步数。 实验结果 输入样例 a1 a2 a1 a3 a1 h8 g2 b8 输出样例 a1==>a2: 3 moves a1==>a3: 2 moves a1==>h8: 6 moves g2==>b8: 5 moves -Description and purpose of the experiment 8* 8 grid for a given board, find the board a horse from one location to another location to reach the shortest path length. Note that horse is to take the "day" shape. Input Enter a number of test data. Only 1 line of each test data, each line has 2 squares pos1, pos2, separated by a space, each grid square, said a board position, the position of column 1 by the said letters ( ah), and that the line of a number (1-8) form, such as "d7" said the line 7 column 4. Output Each line in the input box on the two pos1, pos2, output horse to jump from position pos1 pos2 shortest path length required. Such as "a1 ==> a2: 3 moves" that jump from position a1 a2 minimum required number of steps is 3. Note: The sample shown by the output format of the output, such as "a1 ==> a2: 3 moves" in a space after the colon, and then follow the required minimum number of steps. Experimental results Input sample a1 a2 a1 a3 a1 h8 g2 b8 Sample Ou
Date
: 2025-12-16
Size
: 850kb
User
:
wscnwps
«
1
2
»
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.