Location:
Search - divided conquer
Search list
Description: 本算法使用分治法求解最近点对问题。事先用O(nlogn)时间对x坐标进行排序,使得所有的点是按x坐标从小到大排好序的(x坐标相同时y坐标小的排前),然后取下标小于n/2属于左边的点集PL,取下标大于n/2属于右边的点集PR,即用O(1)时间就可以将规模为n的问题分解为两个规模为n/2的、同类型的子问题。分割完毕之后就可以采用分治法,分别求出PL和PR中的最近点对,最终通过递归实现。-This algorithm uses divide and conquer to solve the problem closest point. Prior to use O (nlogn) time to sort the x coordinate so that all points are based on x coordinates from small to large sorted (x coordinates with the same y coordinates of the small, the top), and then remove the standard is less than n/2 the set of points belonging to the left PL, remove the standard is greater than n/2 set of points belonging to the right of PR, that is to use O (1) time can be the problem size n divided into two size n/2, the same type The sub-problems. Segmentation can be used after completion of sub-rule method, respectively, find the PL and PR in the last points and eventually through the recursion.
Platform: |
Size: 25600 |
Author: lhguo |
Hits:
Description: 单元测试理论PPT,分为四个部分:为什么需要单元测试?怎样征服可测性难题?怎样才能高效率测试?怎样保证测试效果?制作精良,内容精炼。-Unit test theory PPT, divided into four parts: Why unit test? How to conquer the testability problem? How can high-efficiency test? How to ensure test results? Produced, the content of refining.
Platform: |
Size: 1184768 |
Author: 王工 |
Hits:
Description: 分治法的基本思想是将一个规模为n的问题分解为k个规模较小的子问题,这些子问题互相独立且与原问题相同。递归地解这些子问题,然后将各个子问题的解合并得到原问题的解。-The basic idea of divide and conquer method is a problem of size n divided into k sub-problems of smaller, these sub-problems independent of each other and with the same original problem. Solutions to these sub-problems recursively, and then merge the various sub-solution of the problem be the solution the original problem.
Platform: |
Size: 1024 |
Author: 陈振凯 |
Hits:
Description: 分治法的思想是将一个难以直接解决的大问题分割成一些规模较小的几个相似的问题来解决,分治法的求解过程是将整个问题分解成若干个小问题后分而治之,如果分解得到的子问题相对来说还太大,则可反复使用分治策略将这些子问题分成更小的同类型子问题,直至产生出方便求解的子问题,必要时逐步合并这些子问题的解,从而得到问题的解。分治法的求解通常会用到递归,通常会说分治法是一种找大规模问题与小规模问题关系的方法,是递归设计方法的一种具体策略。分治法的基本步骤在每一层递归上都有三个步骤:
① 分解:将原来的规模相对较大的问题分解为规模较小的、相互独立的、与原问题形式相同的子问题。
② 解决:若子问题规模较小而容易解决则直接解决,否则再继续分解为更小的子问题,直到容易解决。
③ 合并:将已求解的各个子问题的解,逐步合并成原问题的解。
当求解一个输入规模为n并且取值比较大的问题时,可以使用分治法提高解决问题的效率。
-The idea is to divide and conquer difficult to directly solve a big problem is divided into some smaller number of similar problems to solve, divide and conquer the whole problem solving process is divided into several small problems of divide and rule, if the decomposition sub-problems are too big, relatively speaking, you can divide and conquer strategy of repeated use of these sub-problems into smaller sub-problems of the same type, until the child produces easy to solve the problem, if necessary, to gradually merge the sub-solution of the problem, to be the solution. Divide and conquer method is usually used for solving recursive, divide and conquer is usually said to find large-scale problems is a problem with the relationship between small-scale method is a recursive design specific strategies. The basic steps to divide and conquer recursion on each floor has three steps:
① decomposition: the relative size of the original large problem into smaller, independent, original proble
Platform: |
Size: 1024 |
Author: ss |
Hits:
Description: 这是关于分治与递归算法的课件,文章详细的讲解了这两周算法的设计要点。-This is about divide and conquer and recursive algorithm courseware, the article explained in detail the design elements of the algorithm for two weeks.
Platform: |
Size: 472064 |
Author: 小韩 |
Hits:
Description: C/C++语言程序中函数调用解决办法pdf阅读版,程序员在设计应用程序时,通常把程序划分为若干功能较为单一的模块,然后分别予以实现,最后再把所有的模块装配起来。这种程序设计中分而治之的策略,被称为模块化程序设计。C语言中,函数是程序的基本组成单位,也是模块化程序设计的惟一工具,使用函数调用和嵌套,可使程序设计变得简单直观、易读和易维护,并可大大地减轻程序员的代码工作量。文章就C/C++语言在程序设计中的解决方法、特点进行阐述。-Function calls in C/C++ language program solutions pdf reader version of programmers in the design of the application, usually the program is divided into a single module of a number of functions, and then were to be realized, and finally the assembly of all modules up. Such a procedure design carved and-conquer strategy, called modular programming. C language function is the basic unit of the program is also the only tool for modular programming, the use of function calls and nested program can design simple and intuitive, easy-to-read and easy to maintain, and can greatly ease the programmer code workload. The article in C/C++ language programming solution, the characteristics described.
Platform: |
Size: 98304 |
Author: 谢昇 |
Hits:
Description: 实验描述:给定X和Y都是n位整数,计算乘积XY。分治算法思想,将n位X和Y分成2段,每段n/2位。则X分为AB两段,Y分为CD两段。
有X=A*(10)^(n/2)+B,Y=C*(10)^(n/2)+D;XY=(A*(10)^(n/2)+B)(C*(10)^(n/2)+D)=AC*(10)^n+(AD+BC)*(10)^(n/2)+BD。 -Experiment: given X and Y are n-bit integers, calculate the product of the XY. The idea of divide and conquer algorithm, the n-bit X and Y is divided into two segments, each n/2. Then X is divided into AB two Y divided into CD two. X = A* (10) ^ (n/2)+B, Y, = C* (10) ^ (n/2)+D the XY = (A* (10) ^ (n/2)+B) (C* (10) ^ (n/2)+D) = AC* (10) ^ n+ (AD+BC)* (10) ^ (n/2)+BD.
Platform: |
Size: 1024 |
Author: tianguochao |
Hits:
Description: 研究生上课所用的算法分析与设计相关文档PPT,分八个章节对算法进行详细介绍:
第1章 算法引论
第2章 递归与分治策略
第3章 动态规划
第4章 贪心算法
第5章 回溯法
第6章 分支限界法
第7章 概率算法
第8章 NP完全性理论
-Graduate classes used in algorithm analysis and design documents the PPT is divided into eight chapters on the algorithm described in detail: Chapter 1 algorithm Introduction Chapter 2 recursive divide and conquer strategy in Chapter 3 of Chapter 4 of the dynamic programming greedy algorithm back in Chapter 5 Chapter 6 France branch and bound method in Chapter 7 of probabilistic algorithms in Chapter 8 of the NP-complete theory
Platform: |
Size: 2043904 |
Author: 独角之灵 |
Hits:
Description: 合并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。 合并排序法是将两个(或两个以上)有序表合并成一个新的有序表,即把待排序序列分为若干个子序列,每个子序列是有序的。然后再把有序子序列合并为整体有序序列。 将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为2-路归并。合并排序也叫归并排序。-Merge Sort is an efficient sorting algorithm merge operation. The algorithm is a typical application of the divide-and-conquer method (Divide and Conquer). Merge sort method is to merge the two (or more) ordered table into a new ordered table to be sorted sequence is divided into a number of sub-sequences, each sub-sequence is ordered. Then put ordered subsequence combined into the overall ordered sequence. Merger will have been ordered sub-sequence, to obtain a complete orderly sequence i.e. so that each first sub-sequence ordered, and then between the sub-sequence segment orderly. If you merge the two ordered list into an ordered table, known as the 2- way merge. The merger the sort also called merge sort.
Platform: |
Size: 1024 |
Author: wangshuangxi |
Hits:
Description: 这题是用分治算法中的折半查找,针对的是一个有序数组,把数组分而治之,把输入分成两个与原来相同的子问题,如果规模还太大,我们对这些子问题再做上述处理,直到这些子问题容易解决为止。这种算法是一种效率很高的算法,每一次循环,它都能将数组的规模减少到原来的半,其空间复杂度是O(log(n))次。-This question is divide and conquer algorithm binary search is for an ordered array, the array of divide and rule, the same as the original input is divided into two sub-problems, if the scale is too large, we do the above for these sub-problems processed until these sub-problems easier to solve so far. This algorithm is a very efficient algorithm, each time through the loop, it can reduce the size of the array to the original and a half, its space complexity is O (log (n)) times.
Platform: |
Size: 168960 |
Author: 莫克 |
Hits:
Description: 许多经典算法问题的源代码,包括数据结构,分治,回溯,动态规划,图论,贪心等等,包括了C,C++和Java代码,已分成文件夹整理好.-Many classical algorithms of the source code, including data structures, divide and conquer, backtracking, dynamic programming, graph theory, greed, etc., including C, C++ and Java code, has been divided into folders tidy.
Platform: |
Size: 101376 |
Author: AIr |
Hits:
Description: 归并排序,采用分治法的一个典型应用。主要步骤可以简单的描述为:【从小到大排序】
第一步:把数组分成左右两个数组,然后递归直至左右数组只包含单个元素【最底层】;
第二步:从单个元素开始,归并数组,使得数值小的在上一层数组的左侧,数值大的在上一层数组的右侧,然后递归,直至到原数组【最顶层】。-Merge sort, using a typical application of divide and conquer method. The main steps can be simply described as: [] The first step in ascending order: the array is divided into left and right arrays, then recursively until around the array contains only a single element [bottom] Step Two: Start from a single element, merge array, making the value of a small layer on the left side of the array, the value in the right layer of the large array, and then recursively until the top level to the original array [].
Platform: |
Size: 632832 |
Author: 贾立伟 |
Hits:
Description: 邮局选址
问题描述:在一个按照东西和南北方向划分成规整街区的城市里,n个居民点散乱地分布在不同的街区中。用x坐标表示东西向,用y坐标表示南北向。各居民点的位置可以由坐标(x,y)表示。要求:为建邮局选址,使得n个居民点到邮局之距离的总和最小。
提示:带权中位数(分治算法)
-Post office location problem description: a north-south direction and in accordance with what is divided into regular city blocks, n scattered settlements located in different neighborhoods. Showing something to coordinate with x, y coordinates used to represent the north and south. Positions of settlements can be represented by the coordinates (x, y). Requirements: In order to build the post office location, so that the n settlements the post office to the sum of the minimum. Tip: weighted median (divide and conquer algorithm)
Platform: |
Size: 112640 |
Author: libaodian |
Hits:
Description: 合并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。合并排序法是将两个(或两个以上)有序表合并成一个新的有序表,即把待排序序列分为若干个子序列,每个子序列是有序的。然后再把有序子序列合并为整体有序序列。将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为2-路归并。合并排序也叫归并排序。(Merge sort is an efficient sorting algorithm based on merging operations. This algorithm is a very typical application of Divide and Conquer. The merge sort method is to merge two or more ordered tables into a new ordered table, that is to say, the sorted sequence is divided into several sub sequences, each of which is ordered. (two). Then the ordered subsequence is merged into the whole ordered sequence. The sequence of ordered subsequences is combined to obtain the sequence of complete order, that is, each subsequence is ordered, and then the subsequence is ordered. If two ordered tables are merged into an ordered table, called 2- path merging. Merge sort is also called merge sort.)
Platform: |
Size: 1024 |
Author: 墨羽如风
|
Hits: