Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - a-w
Search - a-w - List
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-29 Size : 2kb User : 水寒

题目:参加运动会的N个学校编号为1~N.比赛分成M个男子项目和W个女子项目,项目编号分别为1~M和M+1~M+W.由于个项目参加人数差别较大,有些项目取前5名,得分顺序为7,5,3,2,1 还有些项目只取前3名,得分顺序为5,3,2.写一个统计程序产生各种成绩单和得分报表.基本要求:产生各学校的成绩单,内容包括各校所取得的每项成绩的项目号,名次,姓名和得分 产生团体总分报表,内容包括校号,男子团体总分,女子团体总分和团体总分.概要设计:1. 为实现上述程序功能,应以线性表表示集合.2. 本程序包含3个模块:(1) 各集合定义模块(2) 线性表实现模块(3) 主程序模块-topics : participation in the Games N-school No. 1 ~ N. contestants were divided into men item M and W-woman project, a number of M and M ~ ~ 1 M W. As projects vary greatly in the number of participants, some of the items from the former five, scoring sequence of 7,5,3,2,1 also just take some items before the three scores sequence of incidents. write a variety of statistical procedures and report card scoring statements. the basic requirements : have the school report card, which includes school admission the results of each item, ranking names and scores scores statements groups, including schools, the men's team scores, the women's team scores and scores groups. summary of design : 1. to achieve the above functions of the program, said a linear table set .2. this program include
Date : 2025-12-29 Size : 54kb User : 雨后阳光

这是一个分治解决的零件切割问题:给定一块宽度为W的矩形板,矩形板的高度不受限制。现需要从板上分别切割出n个高度为hi,宽度为wi的矩形零件。切割的规则是零件的高度方向与矩形板的高度方向保持一致。问如何切割使得所使用的矩形板的高度h最小?加上一个小界面-This is a solution to the partition cutting parts : a given width of the rectangular plate W, the height of rectangular plate unrestricted. Board is required from the respective cut out n height of the hi, wi width of the rectangular parts. Cutting parts to the rules of the height of the rectangular plate with a high degree of consistent direction. Asked how cutting makes use of the rectangular plate height h minimum? A small interface
Date : 2025-12-29 Size : 30kb User : 亿摆

最小重量机器设计问题 设某一机器由n个部件组成,每一种部件都可以从m个不同的供应商处购得。设w(i,j)是从供应商j处购得的部件i的重量,C(i,j)是相应的价格。 设计一个优先列式分支限界法,给出总价格不超过c的最小重量机器设计。-minimum weight machines based design of a machine n components, each component can be 000 m from different vendors purchased. Let w (i, j) is from the supplier j purchased components of the weight i, C (i, j) is the corresponding price. Design a priority out-branch and bound method, the total price is less than the minimum weight c machine design.
Date : 2025-12-29 Size : 2kb User : 卢起雪

设有n种物品,每一种物品数量无限。第i种物品每件重量为wi公斤,每件价值ci元。现有一只可装载重量为W公斤的背包,求各种物品应各取多少件放入背包,使背包中物品的价值最高。-with n product, every kind of infinite number of copies. I first product for each weight wi kilograms, each worth ci yuan. Existing a carrying weight of the backpack W kilograms, should seek various items each for the number of pieces Add backpack, so backpack maximum value items.
Date : 2025-12-29 Size : 30kb User : 汤烈

Many applications use connection/object pool. A program may require a IMAP connection pool and LDAP connection pool. One could easily implement a IMAP connection pool, then take the existing code and implement a LDAP connection pool. The program grows, and now there is a need for a pool of threads. So just take the IMAP connection pool and convert that to a pool of threads (Copy, paste, find, replace????). Need to make some changes to the pool implementation? Not a very easy task, since the code has been duplicated in many places. Re-inventing source code is not an intelligent approach in an object oriented environment which encourages re-usability. It seems to make more sense to implement a pool that can contain any arbitrary type rather than duplicating code. How does one do that? The answer is to use type parameterization, more commonly referred to as templates.-connection/object pool. A program may require a IMAP connection po ol and LDAP connection pool. One could easily im plement a IMAP connection pool, then take the existing code and implement a LDAP connection pool. The program grows, and now there is a need for a pool of threads. So ju st take the IMAP connection pool and convert tha t to a pool of threads (Copy, paste, find, replace). Need to make some changes to the pool i mplementation Not a very easy task, since the code has been duplicated in many place s. Re-inventing source code is not an intellige nt approach in an object oriented environment w hich encourages re-usability. It seems to make more sense to implement a pool that can contain a ny arbitrary type rather than duplicating code . How does one do that The answer is to use t
Date : 2025-12-29 Size : 170kb User : zhuxin

有向直线K中值问题 给定一条有向直线L以及L 上的n+1 个点x0<x1<x2<… <xn。有向直线L 上的每个点xi都有一个权 w(xi) 每条有向边 (xi,xi-1),也都有一个非负边长d(xi,xi-1)。有向直线L 上的每个点xi 可以看作客户,其服务需求量为w(xi) 。每条边(xi,xi-1) 的边长 , d(xi,xi-1) 可以看作运输费用。如果在点xi 处未设置服务机构,则将点xi 处的服务需求沿有向边转移到点xj处服务机构需付出的服务转移费用为w(xi)*d(xi,xj) 。在点0 x 处已设置了服务机构,现在要在直线L上增设k处服务机构,使得整体服务转移费用最小。 -a straight line to the K value of a given issue to a straight line L and L n a point x0
Date : 2025-12-29 Size : 108kb User : wu

kthtree问题 给定一棵有向树T,树T 中每个顶点u都有一个权w(u);树的每条边(u,v)也都有一个 非负边长d(u,v)。有向树T的每个顶点u 可以看作客户,其服务需求量为w(u)。每条边(u,v)的边长d(u,v) 可以看作运输费用。如果在顶点u 处未设置服务机构,则将顶点u 处的服务需求沿有向树的边(u,v)转移到顶点v 处服务机构需付出的服务转移费用为w(u)*d(u,v)。 树根处已设置了服务机构,现在要在树T中增设k处服务机构,使得整棵树T 的服务转移费用最小-kthtree problems to be fixed to a tree T, T trees each vertex u have a right to w (u); Tree edges (u, v) also have a non-negative side length d (u, v). T to a tree each vertex u can be seen as customers, the demand for its services w (u). Edges (u, v) of length d (u, v) can be considered as transportation costs. If the vertex u Department had not set up the service agencies, will be the culmination u demand for services to a tree along the edge (u, v) v transferred to Vertex's services agencies are required to pay a service fee for the transfer of w (u)* d (u, v). Christopher has set up a service sector, is now in the tree to add k T's services agencies, T entire tree makes the shift to the smallest cost
Date : 2025-12-29 Size : 213kb User : wu

 给定一棵树T,树中每个顶点u都有一个权w(u),权可以是负数。现在要找到树T的一个连通子图使该子图的权之和最大。-given a tree T, tree each vertex u have a right to w (u), the right to be negative. Now to find a tree T connectivity graph so that the graph of the rights and the largest.
Date : 2025-12-29 Size : 146kb User : wu

acm HDOJ 1051WoodenSticks Description: There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated with cleaning operations and changing tools and shapes in the machine. The setup times of the woodworking machine are given as follows: (a) The setup time for the first wooden stick is 1 minute. (b) Right after processing a stick of length l and weight w , the machine will need no setup time for a stick of length l and weight w if l<=l and w<=w . Otherwise, it will need 1 minute for setup. -acm HDOJ 1051WoodenSticksDescription: There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated with cleaning operations and changing tools and shapes in the machine. The setup times of the woodworking machine are given as follows: (a) The setup time for the first wooden stick is 1 minute. (b) Right after processing a stick of length l and weight w, the machine will need no setup time for a stick of length l and weight w if l <= l and w <= w. Otherwise, it will need 1 minute for setup.
Date : 2025-12-29 Size : 1kb User : sxb

零件切割问题: 给定一块宽度为W的矩形板,矩形板的高度不受限制。现需要从板上分别切割出n个高度为hi,宽度为wi的矩形零件。切割的规则是零件的高度方向与矩形板的高度方向保持一致。问如何切割使得所使用的矩形板的高度h最小? 任给一个输入实例,能输出切割所需要的实际高度并能用图形演示切割的过程-cutting parts : a given width of the rectangular plate W, the height of rectangular plate unrestricted. Need from the board is cutting out respectively n height of the hi, wi width of the rectangular parts. Cutting parts to the rules of the height of the rectangular plate with a high degree of consistent direction. Asked how cutting makes use of the rectangular plate height h minimum? As an input for example, will cut output by the needs of the high and can be used graphic demonstration of the cutting proce
Date : 2025-12-29 Size : 64kb User : 章为到

集装箱的装箱问题 给定一个集装箱,其长为L,宽为W和高为H,现有一批圆柱形木材,每根木材的长均为L,但是半径不同,设第i根木材半径为ri。问如何装箱,使得集装箱的空间利用率最高?-problem given a container, its length L, width W and H for high, existing batch of cylindrical wood and each timber are long L, but different radius, based i-radius of the wood-ri. Asked how crates, containers make maximum utilization of space?
Date : 2025-12-29 Size : 80kb User : 吴博

图论中最小生成树Kruskal算法 及画图程序 M-函数 格式 [Wt,Pp]=mintreek(n,W):n为图顶点数,W为图的带权邻接矩阵,不构成边的两顶点之间的权用inf表示。显示最小生成树的边及顶点, Wt为最小生成树的权,Pp(:,1:2)为最小生成树边的两顶点,Pp(:,3)为最小生成树的边权,Pp(:,4)为最小生成树边的序号 附图,红色连线为最小生成树的图 例如 n=6 w=inf*ones(6) w(1,[2,3,4])=[6,1,5] w(2,[3,5])=[5,3] w(3,[4,5,6])=[5,6,4] w(4,6)=2 w(5,6)=6 [a,b]=mintreek(n,w) -Graph theory Kruskal minimum spanning tree algorithm and Paint program M-function format [Wt, Pp] = mintreek (n, W): n for the map Vertices, W for weighted graph adjacency matrix, does not constitute the edge of the two vertices of between the right to express with inf. Show the minimum spanning tree of edges and vertices, Wt right for the Minimum Spanning Tree, Pp (:, 1:2) for the minimum spanning tree edges of the two vertices, Pp (:, 3) for the minimum spanning tree of the right side, Pp ( :, 4) For the minimum spanning tree graph edge serial number, red connection for the minimum spanning tree of graph such as n = 6 w = inf* ones (6) w (1, [2,3,4]) = [ 6,1,5] w (2, [3,5]) = [5,3] w (3, [4,5,6]) = [5,6,4] w (4,6) = 2 w (5,6) = 6 [a, b] = mintreek (n, w)
Date : 2025-12-29 Size : 1kb User : lluo

DL : 0
设有一个背包可以放入的物品重量最重为s,现有n件物品,它们的重量分别为w[0]、 w[1]、w[2]、…、w[n-1]。问能否从这n件物品中选择若干件放入此背包中,使得放入的重量之和正好为s。如果存在一种符合上述要求的选择,则称此背包问题有解(或称其解为真);否则称此背包问题无解(或称其解为假)。试用递归方法设计求解背包问题的算法。-There is a backpack weight items can be placed the most weight of s, the existing n items, and their respective weights for w [0], w [1], w [2], ..., w [n-1]. Asked whether the items from the n number of pieces of select Add this backpack makes Add the weight of and an opportunity for s. If there is a choice of these requirements, then the knapsack problem solvability (or its solution is true) otherwise said no solution to this knapsack problem (or its solution to be false). Trial designed recursive algorithm for solving knapsack problem.
Date : 2025-12-29 Size : 244kb User : 张巨松

(1).问题描述:集装箱的装箱问题 给定一个集装箱,其长为L,宽为W和高为H,现有一批圆柱形木材,每根木材的长均为L,但是半径不同,设第i根木材半径为ri。问如何装箱,使得集装箱的空间利用率最高? (2).程序设计要求: a. 设计一个贪心算法 b. 任给一个输入实例,能输出集装箱的空间利用率 c. 能用图形演示装箱的过程 演示: 输入要测试的文件名,如c17.txt,程序将给出结果,并用图形演示。-err
Date : 2025-12-29 Size : 13kb User : 小明

给定一个集装箱,其长为L,宽为W和高为H,现有一批圆柱形木材,每根木材的长均为L,但是半径不同,设第i根木材半径为ri。问如何装箱,使得集装箱的空间利用率最高? 原创 里面附有详细报告。-Given a container, and its length L, width W and height H, the current batch of cylindrical timber, each timber are of a long L, but the radius is different from the first i set the root timber radius ri. Asked how the packing, making maximum utilization of container space? Original inside with a detailed report.
Date : 2025-12-29 Size : 124kb User : gillli

实现最优二叉树的构造;在此基础上完成哈夫曼编码器与译码器。 假设报文中只会出现如下表所示的字符: 字符 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-29 Size : 129kb User : 张娟

DL : 0
 给定一棵有向树T,树T中每个顶点u都有一个权w[u],树的每条边[u,v]也都有一个非负边长d[u,v]。有向树T的每个顶点u可以看做客户,其服务需求量为w[u]。每条边[u,v]的边长d[u,v]可以看做是运输费用。如果在顶点u处未设置服务机构,则将顶点u处的服务需求沿有向树的边(u,v]转移到顶点v处服务机构,则需付出的服务转移费用为w[u]*d[u,v]。树根处已设置了服务机构,现在要在树T中增设k处服务机构,使得整棵树T的服务转移费用最小。该算法对于给定的有向树T,计算在树T中增设k处服务机构的最小服务转移费用。 -Given to have a tree T, the tree T for each vertex u has a right to w [u], each tree edge [u, v] also has a non-negative edge length d [u, v]. Tree T has to each vertex u can be seen as customers, demand for their services w [u]. Each edge [u, v] of side length d [u, v] can be seen as are transportation costs. If vertex u Department is not set service agencies will be vertex u Services Department needs to have trees along the edge [u, v] transferred to the vertex v Department service agencies, it would take to pay the service fee for the transfer of w [u]* d [u, v]. Shugen Services Department has set up institutions, now in the tree T and a new k Department service agencies, making整棵Transfer Service tree T of minimum cost. The algorithm for a given directed tree T, calculated in the tree T and a new k services agencies transfer the cost of the smallest services.
Date : 2025-12-29 Size : 1kb User : yxd

课程设计: 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-29 Size : 538kb User : 赵刚

赋权有向图中心问题 问题描述: 设G=(V,E)是一个赋权有向图,v是G的一个顶点, v的偏心距定义为: Max {w∈ V,从w到v的最短路径长度} G中偏心距最小的顶点称为G的中心。试利用Floyd 算法设计一个求赋权有向图中心的算法。-Empowering the central issue Digraph Problem Description: Let G = (V, E) is a directed graph Empowering, v is a G vertex, v is defined as the eccentricity: Max (w ∈ V, from w to v the shortest path length) G the minimum eccentricity of the vertex as the center of G. Try using Floyd algorithm for the design of a plan to empower the center to the algorithm.
Date : 2025-12-29 Size : 82kb User : 林建
« 12 3 »
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.