简体   繁体   English

如何解决下面的递推关系问题

[英]How to solve the below recurrence relation question

Consider a recursive algorithm that break a given problem into five parts.考虑将给定问题分成五个部分的递归算法。 Out of these five parts the algorithm utilizes three parts and discards two parts.在这五个部分中,算法利用了三个部分并丢弃了两个部分。 The chosen parts are broken into five again and the same process is recursively repeated until the problem size is 1. Once the problem size is 1, the individual parts are recombined.将选择的部分再次分成五个部分,并递归重复相同的过程,直到问题大小为 1。一旦问题大小为 1,则重新组合各个部分。

  1. Write a recurrence relation for the above algorithm.写出上述算法的递推关系。 Please state your assumptions.请陈述你的假设。
  2. Solve the recurrence relation developed in part 1 above using the Substitution Method.使用替换方法求解上面第 1 部分中开发的递推关系。 Specify the guess and the method you used in deciding that guess.指定猜测以及您在决定该猜测时使用的方法。

Please let know the answer even if you know only for the part 1. Thank you!即使您只知道第 1 部分,也请告知答案。谢谢!

This depends on what you mean by the "parts" of the problem.这取决于您所说的问题的“部分”是什么意思。 If the initial problem is some sort of data structure, particularly an array of numbers, then in the first part you would divide the structure into five categories based on certain properties of the numbers, and then discard two of those categories and repeat the process on the remaining 3. Just to be clear, is this the exact wording of a homework problem you were given?如果最初的问题是某种数据结构,尤其是数字数组,那么在第一部分中,您将根据数字的某些属性将该结构分为五个类别,然后丢弃其中的两个类别并重复该过程剩下的 3. 澄清一下,这是给你的作业问题的确切措辞吗? It would be good to have some information.最好有一些信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM