代做divide-and-conquer algorithm
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
- 创意驱动增长,Adobe护城河够深吗?
- 中国建筑涂料门户:引领行业潮流,绘就美丽中国
- Instagram自动打粉营销软件,Ins引流助手,共同助你赢得市场!
- Instagram群发消息工具,Ins模拟器群发软件,助你快速营销!
- 跨国战略部署:全球app云筛是制定全球营销计划的得力助手
- Ins群发群控工具,Instagram多开云控群发,助你实现营销目标!
- 微软电脑管家发布2周年:携手用户,共创价值
- 华秋荣膺2023年度中国智能生产杰出应用奖,一站式数智化服务引领电子产业创新升级
- 迈尔微视:为人形机器人视觉感知提供精准解决方案
- 全方位Telegram代群发,从梦想到现实,通过Telegram工具实现了生意的喜悦变现
- 定向推送,品牌广受欢迎!商家 跨境电商WhatsApp代拉群,引领市场销售新浪潮
- Ins打粉营销工具,Instagram群发工具,共同助你开拓营销新天地!
- 几近无痕!广州市妇女儿童医疗中心率先完成10台单孔机器人胆总管囊肿手术
- 世贸通美国EB5投资移民美国留学教育:大学择校内幕
- 你发现了这款WhatsApp拉群营销工具吗 快来分享一下你的使用心得吧
- 时尚推广,前沿技术!尝试 跨境电商WhatsApp协议号注册器云控群发软件,品牌曝光不再是难题
- 以前没有WhatsApp拉群工具 我的推广活动就像是在大海里撒网 茫茫人海 难以寻觅到真正有意向的顾客 投入的时间和精力都像是石沉大海 难以泛起一丝波澜
- Ins/IG群发营销助手大揭秘!Instagram暴力批量私信软件推荐!
- ins/ig精准采集软件,instagram最新群发引流软件推荐
- <启诺实时云会议管理系统>获得创新资金A档立项
- 开学第一课:做好近视管理,别让孩子视力“掉队”!
- 推动新质生产力发展,开年之际商越持续助力多家大中企业采购降本增效
- 河北医科大学第四医院实施河北省首例单孔机器人同期胃肿瘤联合胆囊切除术
- 一键群发,轻松推广!探索新时代的 跨境电商VB代拉群革新之路
- WhatsApp筛选器适合什么群体使用,WhatsApp工具如何简化流程,轻轻松松提升效果!
- 视博医疗集团总部及研发生产基地项目封顶仪式顺利举行
- Instagram引流推广软件攻略,Ins全自动采集软件火热上线!
- WhatsApp营销软件,ws拉群业务/ws协议号/ws美国号/ws业务咨询大轩
- Ins私信群发神器,Instagram注册工具一键购买平台!
- 掌上设备:掌中世界,触手可及
推荐
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技