Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - n2-1
Search - n2-1 - List
最小生成树的prim算法 是求图中的最短路径的一个重要算法 但是是O(n2)复杂度的一个算法-minimum spanning tree algorithm is the prim map for the shortest path algorithm of an important but is O (n2) of a complex algorithm
Date : 2026-01-09 Size : 3kb User : 袁文

对链表进行排序,时间复杂度O(n2),类似于插入排序的思想-right sort, time complexity O (n2), similar to the sequencing of the insert thinking
Date : 2026-01-09 Size : 160kb User : 苗建新

DL : 1
设计一个O(n2)时间的算法,找出由n个数组成的序列的最长单调递增子序列。-design an O (n2) time algorithm to identify by the number n of the longest sequence monotonically increasing sequences.
Date : 2026-01-09 Size : 1kb User : 33

计数排序是一个非基于比较的线性时间排序算法。它对输入的数据有附加的限制条件: 1、输入的线性表的元素属于有限偏序集S; 2、设输入的线性表的长度为n,|S|=k(表示集合S中元素的总数目为k),则k=O(n)。 在这两个条件下,计数排序的复杂性为O(n)。 计数排序算法的基本思想是对于给定的输入序列中的每一个元素x,确定该序列中值小于x的元素的个数。一旦有了这个信息,就可以将x直接存放到最终的输出序列的正确位置上。例如,如果输入序列中只有17个元素的值小于x的值,则x可以直接存放在输出序列的第18个位置上。 计数排序算法没有用到元素间的比较,它利用元素的实际值来确定它们在输出数组中的位置。因此,计数排序算法不是一个基于比较的排序算法,从而它的计算时间下界不再是Ω(nlogn)。另一方面,计数排序算法之所以能取得线性计算时间的上界是因为对元素的取值范围作了一定限制,即k=O(n)。如果k=n2,n3,..,就得不到线性时间的上界。-Count ranking is based on a comparison of non-linear time sorting algorithm. Its input data Additional restrictions : 1, the importation of the linear element is a limited poset S; 2. The linear input based on the length of the table n | S | = k (S said set of elements in the total number of k), k = O (n). In these two conditions, the ranking counting for the complexity of O (n). Counting sorting algorithm is the basic idea for a given input sequence of each element x, determine the sequence x value is less than the number of elements. Once this information, it can be placed directly x to the final output the correct sequence position. For example, if the input sequence, only 17 elements in the value of x is less than the value then x can be placed directly on the output sequence of 18 pos
Date : 2026-01-09 Size : 1kb User : 金龙

DL : 0
最小生成树Prim算法的实现,时间复杂度O(n2)-Prim minimum spanning tree algorithm, time complexity O (n2)
Date : 2026-01-09 Size : 6kb User : 赵仕济

/*快速排序采用分治算法,将所需要排序的内容从文件读入放入数组a[p:r],按以下三个步骤进行排序 以a[p]为基准元素将数组分为三段,将大于基准元素的放到后面的单元,小的放到前面的单元, 再用递归对a[p:q-1],a[q+1:r]进行排序,最后合并 时间复杂度:最坏时间复杂度:O(n2) 平均时间复杂度:O(nlogn) */-/* Quick sort algorithm using sub-rule will be needed to sort the contents read from the file Add the array a [p: r], according to the following three steps to sort a [p] as the base element to the array is divided into three sections , will be greater than the base element on the back of the unit, put in front of a small unit, and then recursively to a [p: q-1], a [q+ 1: r] sort, the last time complexity of the merger degree: the worst time complexity: O (n2) the average time complexity: O (nlogn)* /
Date : 2026-01-09 Size : 1kb User : stone

程序功能:1.由n2个方块排成n行n列的正方形称为n元棋盘。 如果两个皇后位于n元棋盘上的同一行、同一列或同一对角线上,则称它们在互相攻击。 现要找出使棋盘上n个皇后互不攻击的布局。 2.编制程序解决上述问题, 用户输入0~30间的棋盘方阵,给出所有解决方案,并输出结果。 -queens of different table sizes
Date : 2026-01-09 Size : 89kb User : lfm

Longest Common Subsequence A simple way of finding the longest increasing subsequence is to use the Longest Common Subsequence (Dynamic Programming) algorithm. 1. Make a sorted copy of the sequence A, denoted as B. O(nlog(n)) time. 2. Use Longest Common Subsequence on with A and B. O(n2) time. - Longest Common Subsequence A simple way of finding the longest increasing subsequence is to use the Longest Common Subsequence (Dynamic Programming) algorithm. 1. Make a sorted copy of the sequence A, denoted as B. O(nlog(n)) time. 2. Use Longest Common Subsequence on with A and B. O(n2) time.
Date : 2026-01-09 Size : 8kb User : jiraheta

约瑟夫环,设有n个人围坐在一个圆桌周围,现从第s个人开始报数,数到第m的人出列,然后从出列的下一个人重新开始报数,数到第m的人又出列,…,如此反复直到所有的人全部出列为止。以n=8,s=1,m=4为例,若初始的顺序为 n1,n2,n3,n4,n5,n6,n7,n8。则问题的解为n4,n8,n5,n2,n1,n3,n7,n6。-Joseph Wan, with n individuals sitting around a round table, is reported starting from the number of individuals s, m the number of people to the column and the column from the next person to start reporting the number of numbers to m, who has a column, ..., and so forth until all the people all of the column so far. To n = 8, s = 1, m = 4, for example, if the initial order of n1, n2, n3, n4, n5, n6, n7, n8. The solution of the problem n4, n8, n5, n2, n1, n3, n7, n6.
Date : 2026-01-09 Size : 186kb User : ll

设计并实现一个简单的行编辑系统。该系统提供5条编辑子命令: open 文件名:将指定文件读入内存; quit:将正在编辑的文件写回文件,退出编辑系统; list n1 – n2:显示第n1到第n2行的内容; del 行号,列号,字符数:从指定位置开始删除指定的字符数; ins 行号,列号,字符串:在指定位置插入字符串。-Design and implement a simple line editing system. The system provides five sub-editing commands: open file name: The specified file is read into memory quit: to write back the file being edited file, exit the editing system list n1- n2: n1 to n2 Display the contents of the line del row number, column number, the number of characters: delete the specified position from the specified number of characters ins line number, column number, the string: insert string in the specified location.
Date : 2026-01-09 Size : 1kb User : lijinping

complexity of the algorithm O(n^2) O(n) O(n*logn)
Date : 2026-01-09 Size : 317kb User : Aygerim

/*综合性试验(排序二叉树) 1.建立一棵排序二叉树(随机产生1000个0~999的数) 2.前、中、反中序遍历 3.统计叶子数、结点数、深度 4.查找、插入、删除 5.求最大、最小值 6.求查找的次数n1,与二分查找作比较(n1>n2,二叉树不均衡) 7.排序算法与中序遍历的效率比较 *8.将上述各步的结果写入文件(result.txt)-/* Test (sort of binary tree) (1) to establish a sort binary tree (randomly generated 1000 the number of 0 to 999) , Anti-inorder traversal 2. Statistics leaf number, number of nodes, depth Find, insert, delete Find the maximum and minimum values Seek to find the number n1, and the binary search (n1> n2, the binary tree is not balanced) The efficiency of sorting algorithms and in-order traversal * 8. The results of the above steps to write to a file (result.txt)
Date : 2026-01-09 Size : 3kb User : 向曦

在计算机内部排序的各种算法中 ,用比较大小的方法进行排序时间耗费的最好特性为 O(nlog2 n) ,最坏情况下还会上升到 O(n2 ) [1] 。要达到其理论下界log2 n1≈ nlog2 n- 1.4 4 n是非常困难的。Hashsort 一种散列排序方法-The best features of the computer' s internal sorting algorithm, the sort of time-consuming method of comparative size O (nlog2 n), the worst case will rise to the O (n2) [1]. To achieve its theoretical Lower Bound log2 N1 ≈ nlog2 N-1.4 4 n is very difficult. The Hashsort sort of a hashing method
Date : 2026-01-09 Size : 1kb User : liming

利用非递归算法将正整数n表示成一系列正整数之和,n=n1+n2+...+nk,其中n1>=n2>=n3>=...>=nk>=1,k>=1。 正整数n的这种表示称为正整数n的划分。 -N represents a positive integer into a series of positive integers and the use of a non-recursive algorithm, n = n1+n2+ ...+nk, wherein n1 = n2 = n3 = ...> = nk> = 1, k> = 1. The positive integer n such means as framing the positive integer n.
Date : 2026-01-09 Size : 1kb User : chenmeixia

DL : 0
该文件是产生两组随即的高斯分布系列,均值为0,均方差为N2,-This file is the series of two groups of random gaussian distribution, the mean to 0, mean square error as the N2,
Date : 2026-01-09 Size : 502kb User : gwsersioc

该文件是产生两组随即的高斯分布系列,均值为0,均方差为N2,-This file is the series of two groups of random gaussian distribution, the mean to 0, mean square error as the N2,
Date : 2026-01-09 Size : 502kb User : gwsersioc
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.