商业通讯
请输入关键词
  • 首页
  • 资讯
  • 科技
  • 财商
  • 汽车
  • 家电
  • 生活
首页 > 科技

代做divide-and-conquer algorithm

发布于:2024-04-10 11:52:39 来源:互联网


Question 1 (25pt)
Given the input , track the divide-and-conquer algorithm to find the maximum contiguous subarray. You need to show the recursive calls as a tree. The input and output for each recursive call should also be indicated as well. 

Question 2 (25pt)
Given two polynomials  and , track the  algorithm to calculate . You need to show the recursive calls as a tree. The input and output for each recursive call should also be indicated as well.

Question 3 (20pt)
In the deterministic linear-time divide-and-conquer algorithm taught in class for the selection problem, the input array is divided into groups of 5 elements. Analyze the running time of the algorithm if the input array is divided into groups of 7. Does your algorithm run in linear time?

Question 4 (15pt)
A segment  is a pair of positive integers , where . Two segments  and  intersect if . 
Given a sequence  of  segments sorted increasingly by ’s ( if ) within the  ( for all ), design a divide-and-conquer algorithm to justify if there are two segments intersect. 
You need to 
a)Describe your algorithm in a high-level presentation. (5pt)
b)Write down the pseudo code. (5pt)
c)Analyze the time complexity of your algorithm. (5pt)

Question 5 (10pt)
In lecture 3, we studied the divide-and-conquer algorithm for the polynomial multiplication problem. To let polynomials evenly split into sub-polynomials, the algorithm on page 17 (Line 4 - 7) nicely considers all the cases and uses the ceiling function (the last term in  is ).
However, Goliath is lazy. He does not want to use any ceiling function or floor function in his implementation. To make his life easy, he simply assumes that 
“The number of terms in the polynomials is always an integer power of .”
In other words,  for some .
But, the polynomial multiplication problem in general contains polynomials whose number of terms is not an integer power of 2. Thus, you need to 
a)Define a method  to convert polynomials in general to polynomials whose number of terms is an integer power of 2. (5pt)
b)Discuss the consequence by doing so. Does it increase the time complexity comparing to the original algorithm (Algorithm 2 on page 17 in lecture 03)? Why? (5pt)
(Hint: please pay attention to the input size)
Assume Goliath’s implementation has the interface . You can consider that the algorithm with Goliath’s implementation works as follows.

请加QQ:99515681  邮箱:99515681@qq.com   WX:codinghelp

上一篇:中国建筑涂料门户:引领行业潮流,绘就美丽中国

下一篇:莱特波特(LitePoint)与研华科技(Advantech)利用无线设计服务改变物联网(IoT)发展

热门文章

  • 福特电动车卖不动?只有一半汽车经纪明年想卖纯电动车

    2023-12-23
  • 春节将至,河南致信返乡人员:期盼你们返乡创业就业,在外学到的知识带回来,献计献策!

    2024-01-12
  • 新政落地后首周北京二手房日均成交量上涨11%

    2023-12-23
  • 独行侠首节44分!兰德尔:欧文定下了基调 我们的防守没存在感

    2024-01-12
  • 周口城投城市运营丨聚焦城市发展 彰显国企担当

    2023-12-23
  • 东芝退市折射日企创新困局

    2023-12-23

本站部分文字及图片均来自于网络,如有侵权请及时联系删除处理

Copyright ©2023-2024 商业通讯.Powered by © hubeizhichuang.com