代写data structure编程、数据结构编程作业帮做、代写留学生数据结构课程设计

Design and Analysis of AlgorithmsHomework 1Put each of the problems on a separate sheet of paper, and make sure your name is oneach sheet. To hand them in, staple them together and bring them to the class on due date.Please make sure to express your algorithms in pseudo-code when directed (see the coursetextbook for the proper pseudo-code style), and always provide justi cation for your answerwhen asked to give the running time of an algorithm. Be brief and concise, and draw pictureswhere appropriate.Problem 1.a) Show that if f(n) is O(g(n)) and d(n) is O(h(n)), then f(n) d(n) is O(g(n) h(n)).b) Show that 3(n + 1)5 + 2n3 logn is O(n5).c) Algorithm A executes 10n2 logn operations, while algorithm B executes n3 operations.Determine the minimum integer value n0 such that A executes fewer operations thanB for n n0.Problem 2.a) What does the following algorithm do? Analyze its worst-case running time, and expressit using Big-Oh&" notation.Algorithm Foo (a, n):Input: two integers, a and nOutput: ?k 0b 1while k 0 doif k mod 2 = 0 thenk k=2c c celsek k 1b b creturn bProblem 3.a) Describe the output of the following series of stack operations on a single, initially emptystack:push(5), push(3), pop(), push(2), push(8), pop(), push(9), push(1), pop(), push(7),push(6), pop(), pop(), push(4), pop(), pop().b) Describe the output of the following series of queue operations on a single, initially emptyqueue:enqueue(5), enqueue(3), dequeue(), enqueue(2), enqueue(8), dequeue(), enqueue(9),enqueue(1), dequeue(), enqueue(7), enqueue(6), dequeue(), dequeue(), enqueue(4),dequeue(), dequeue().c) Describe in pseudo-code a linear-time algorithm for creating a copy stack S0 of a stack S.As the result, you must end up with two identical stacks S0 and S. To access the stack,you are only allowed to use the methods of stack ADT.d) Describe how to implement two stacks using one array. The total number of elements inboth stacks is limited by the array length; all stack operations should run in O(1) time.Problem 4. In year 2069 the eleventh hovercraft of the class MARK III came o theassembly lines of the Boeing Company’s (misnamed) rotorcraft division. This hovercraft wascalled Nebuchadnezzar.&" Unfortunately, the core libraries of Nebuchadnezzar were corruptedduring installation, so the only uncorrupted data structure left was a simple stack. Boeingsoftware engineers set out to reimplement all the other data structures in terms of stacks,and they started out with queues.a) The following are parts of their original implementation of a queue using two stacks(in stack and out stack). Analyze the worst-case running times of its enqueue anddequeue methods and express them using Big-Oh&" notation.Algorithm enqueue(o)in stack.push(o)Algorithm dequeue()2while (! in stack.isEmpty()) doout stack.push(in stack.pop())if (out stack.isEmpty()) thenthrow a QueueEmptyExceptionreturn obj out stack.pop()while (! out stack.isEmpty()) doin stack.push(out stack.pop())return return obj;b) Sometime in the early twenty- rst century a war erupted between the humans and themachines, which humans lost. 120 years after its creation, the hovercraft Nebuchadnez-zar ended up in the hands of the human resistance leader and hacker extraordinaire,Morpheus. Always on the run, the rebels needed much faster software to escape themachines, so Morpheus and his crew set out to optimize Neb’s code. Thus a newimplementation of a queue (still using two stacks) was born:Algorithm enqueue(o)in stack.push(o)Algorithm dequeue()if (out stack.isEmpty()) thenwhile (! in stack.isEmpty()) doout stack.push(in stack.pop())if (out stack.isEmpty()) thenthrow a QueueEmptyExceptionreturn out stack.pop()What is the worst-case complexity of performing a series of 2n enqueue and n dequeueoperations in an unspeci ed order? Express this using Big-Oh&" notation.Problem 5. A program Thunk written by a graduate student uses an implementationof the sequence ADT as its main component. It performs atRank, insertAtRank andremove operations in some unspeci ed order. It is known that Thunk performs n24 atRankoperations, n insertAtRank operations, and n2 remove operations. Which implementationof the sequence ADT should the student use in the interest of e ciency: the array-based oneor the one that uses a doubly-linked list? Explain.& 本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(代写data structure编程、数据结构编程作业帮做、代写留学生数据结构课程设计)