Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

The time complexity of algorithms.

30/10/2020 Client: sudharsansrinivasp Deadline: 7 Days

 


Researchers from the School of BioSciences have requested our help with one of their


experiments. They are performing behavioural experiments with zebrafish. At any one instance in


time there are a large number of zebrafish in the aquarium. For their particular experiment, the


biologist take a snapshot of the aquarium and then need to find the longest series of zebrafish such


the length of each fish along the horizontal direction in the aquarium is increasing. They also need


to know the number of zebra fish in this series.


For example, the snapshot of the aquarium resulted in fish lengths of [2, 5, 3, 7, 11, 1, 12, 4, 15, 14, 6, 16].


One possible longest series of increasing lengths in this case is [2, 3, 7, 11, 12, 14, 16] with 7 zebrafish.


We say one possible longest series of increasing lengths here because it is not necessarily unique.


For example, the length 14 in the output could be replaced with 15: [2, 3, 7, 11, 12, 15, 16] and also


be valid.


In this question you will consider algorithms for finding the longest series of increasing lengths


via the function LongestIncreasingLengths(A[0, · · · , n − 1]), as well as the size of this output


array.


(a) [1+2+1 = 4 Marks] Consider a recursive algorithm:


i [1 Mark]Write down a recurrence relation for the function LongestIncreasingLengths.


ii [2 Marks] Using this recurrence relation, write a recursive algorithm in pseudocode for


LongestIncreasingLengths that only calculates the array size of the longest series of


increasing lengths. You do not need to output the actual array containing the longest


series of increasing lengths in this part of the question. For the example above with input


A = [2, 5, 3, 7, 11, 1, 12, 4, 15, 14, 6, 16], the output should just be 7. The pseudocode should


be about 10 lines of code.


iii [1 Mark] What is the time complexity of this recursive algorithm? Justify your answer.


(b) [5+1+1 = 7 Marks]


i [5 Marks] Building on from your recursive algorithm in part (a), write down a dynamic


programming implementation in pseudocode for the function


LongestIncreasingLengths(A[0, · · · , n − 1]) to find the longest series of increasing


lengths. This should also output the size of the longest series of increasing lengths. The


pseudocode should be about 20 lines of code.


ii [1 Mark] Explain how the recurrence relation used for your dynamic programming imple-


mentation involves overlapping instances.


iii [1 Mark] What is the time complexity of your algorithm and how much auxiliary space


was required. Justify your answer.


(c) [1+2 = 3 Marks] The time complexity of the recursive algorithm for LongestIncreasingLengths


was exponential, while the dynamic programming algorithm lead to a polynomial


time complexity (note, you need to determine that polynomial above). Here we will investigate


an algorithm for the function LongestIncreasingLengths that has a time complexity of


O(n log n).


Consider building a set of arrays for the input array A[0, · · · , n − 1]. As we scan along A, we


will compare A[i] with the final element in each array in this set. This comparison will satisfy


the following conditions:


(1) If A[i] is smaller than the final element in each array, start a new array of size 1 with A[i].


(2) If A[i] is larger than the final element in each array, copy the longest array and append


A[i] to this new array.


(3) If A[i] is in between, find the array with the final element that is greater than A[i] and


replace that element with A[i].


i [1 Mark] Write down the set of arrays that satisfy these rules for the input array


A = [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15].


ii [2 Marks] Building from these conditions, explain how an algorithm for the function


LongestIncreasingLengths could run with time complexity O(n log n). You may make


use any algorithm introduced in the lectures to help you with your explanation. Note: you


do not have to write this algorithm in pseudocode. We are expecting that you write a short


paragraph or a short list of bullet points describing the important steps of the algorithm


to explain the time complexity.


Hint: what if you only consider the final elements of this set of arrays as a single array?

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

A+GRADE HELPER
Finance Homework Help
Custom Coursework Service
Helping Hand
Innovative Writer
Essay & Assignment Help
Writer Writer Name Offer Chat
A+GRADE HELPER

ONLINE

A+GRADE HELPER

Greetings! I’m very much interested to work on this project. I have read the details properly. I am a Professional Writer with over 5 years of experience, therefore, I can easily do this job. I will also provide you with TURNITIN PLAGIARISM REPORT. You can message me to discuss the detail. Why me? My goal is to offer services to you that are profitable. I don’t want you to place an order once and that’s it. For me to be successful, I need you to come back and order again. Give me the opportunity to work on your project. I wish to build a long-term relationship with you. We can have further discussion in chat. Thanks!

$55 Chat With Writer
Finance Homework Help

ONLINE

Finance Homework Help

I have a Master’s degree and experience of more than 5 years in this industry, I have worked on several similar projects of Research writing, Academic writing & Business writing and can deliver A+ quality writing even to Short Deadlines. I have successfully completed more than 2100+ projects on different websites for respective clients. I can generally write 10-15 pages daily. I am interested to hear more about the project and about the subject matter of the writing. I will deliver Premium quality work without Plagiarism at less price and time. Get quality work by awarding this project to me, I look forward to getting started for you as soon as possible. Thanks!

$55 Chat With Writer
Custom Coursework Service

ONLINE

Custom Coursework Service

Hey, Hope you are doing great :) I have read your project description. I am a high qualified writer. I will surely assist you in writing paper in which i will be explaining and analyzing the formulation and implementation of the strategy of Nestle. I will cover all the points which you have mentioned in your project details. I have a clear idea of what you are looking for. The work will be done according to your expectations. I will provide you Turnitin report as well to check the similarity. I am familiar with APA, MLA, Harvard, Chicago and Turabian referencing styles. I have more than 5 years’ experience in technical and academic writing. Please message me to discuss further details. I will be glad to assist you out.

$55 Chat With Writer
Helping Hand

ONLINE

Helping Hand

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism as I am a master writer with 5 years experience in similar ps and research writing projects. Kindly send me more information about your project. You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$55 Chat With Writer
Innovative Writer

ONLINE

Innovative Writer

I have read and understood all your initial requirements, and I am very professional in this task, I would be the best choice for this project, I am a PhD writer with 6-7 years of experience and can deliver quality notes to tight deadlines. I can generally compile up to 10 pages of lecture notes per day. I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$55 Chat With Writer
Essay & Assignment Help

ONLINE

Essay & Assignment Help

I have a Master’s degree and experience of more than 5 years in this industry, I have worked on several similar projects of Research writing, Academic writing & Business writing and can deliver A+ quality writing even to Short Deadlines. I have successfully completed more than 2100+ projects on different websites for respective clients. I can generally write 10-15 pages daily. I am interested to hear more about the project and about the subject matter of the writing. I will deliver Premium quality work without Plagiarism at less price and time. Get quality work by awarding this project to me, I look forward to getting started for you as soon as possible. Thanks!

$55 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

POLICY - The distance from the planets to the sun - Mis midterm - 2 in 1 - Compare and contrast - Discussion - Two couples act on the beam - Lord and taylor mac makeup - Exponential word problems examples - Http www codeblocks org downloads - Psychology movie review assignment - Research - Whs legislation that impacts development of keyboard skills - Distribution channel of maruti suzuki - Little books inc recently reported - Suggest data validation checks for data entry screens - ECON Questions - Why did you choose nursing as your major? - Week 4 discussion - The data selected to create a chart must include - Glasgow royal infirmary wards - Efe matrix of coca cola - Bbb vvv gg mahal - Vcaa specialist maths formula sheet - RP - Sbi net banking saral - And then there were none chapter 11 - All motown acts were subjected to charm school to - Buffer overflow attack example java - Http academic brooklyn cuny edu geology grocha mineral streak html - Billabong financials - Hpe enterprise secure key manager - 15 simplify the expression below show your work 7y 24 - Elysium of the blue sky sheet music - What is the shape of ad orbital - Journal article critique example apa format - Market research survey - Risk breakdown structure for a wedding - Using the Web or other resources, find out what your states, laws are regarding cyber stalking. Write a brief essay describing those laws and what they mean. - Practice test 1 scoring - Triple aim of health reform - Help - A day in our shoes iep - Impulse and momentum lab answers - Mendelian genetics lab answer key - Assignment: Diversity, Equity, and Social Justice - Mr bookman seinfeld bloopers - Amount of total revenue recorded in the ledger - Identify the sources of emotions and moods - Highered mcgraw hill osmosis animation - Hbr working capital simulation for sunflower nutraceuticals - Jcu withdrawal without academic penalty - Goodweek tires inc case study - German hyperinflation of 1923 - Www cbussuper com au - Policy Process Report - The painting lesson poem by trevor harvey - Jeff nippard chest hypertrophy program - Calculate the formula mass of nahco3 - Harvard business publishing online - How to turn off casio fx 260 solar calculator - Writing small numbers in scientific numbers - Ingenico ict250 auto settlement - Exercise 23 questions to be graded - The new power program new protocols for maximum strength pdf - Growth and benefits of direct marketing - Literary devices used in story of an hour - Goods with many close substitutes tend to have - Brandon brown versus yucatan chapter 4 - Social decentering example - Anne reid doc martin - Guns germs and steel thesis - A biological community's productivity is a measure of - Firestone w01 358 7001 - Act gov jobs au - Nursing process worksheet - Tonyas gluten free kitchen soft pretzel pieces original 10.8 oz - Cisco collaboration servers and appliances exam 500 325 - The return of martin guerre summary - Dsadd a referral was returned from the server - Article Assignment - APA Paper Correction - Nos van a servir el café - Chastity and shane are fraternal twins born 17 minutes apart - I need 240 words letter on Department of Communication & Public Relations - Vernier height gauge least count formula - Marketing simulation game report - Graduate Education Assistance - Christian concept of imago dei in healthcare - How many km in a light year - Trichomonas - Mastery of multiplication facts - Stars and the hr diagram worksheet answers - Solving management questions - Information tech - ¿quién es la primera persona que está en el baño? felipe marissa - George Orwell’s Politics and the English Language - What is the mole ratio of nh3 to n2 - Enterprise risk management and firm performance a contingency perspective - BE D8