Give an efficient algorithm that takes strings s x and y

Assignment Help Data Structure & Algorithms
Reference no: EM131955338

Programming Assignment: Foundations of Algorithms

The following is a problem to be completed by the individual (i.e., it is not collaborative) and then implemented. You may use any programming language you wish. Follow the requirements provided under Syllabus & Course Information under the link Programming Assignment Requirements.

1. Programming (non-collaborative)Due at the end of Module 13. You are consulting for a group of people (who would prefer not to be mentioned here by name) whose job consists of monitoring and analyzing electronic signals coming from ships in the Atlantic ocean. They want a fast algorithm for a basic primitive that arises frequently: untangling a superposition of two known signals. Specifically, they are picturing a situation in which each of two ships is emitting a short sequence of 0s and 1s over and over, and they want to make sure that the signal they are hearing is simply an interleaving of these two emissions, with nothing extra added in.

This describes the whole problem; we can make it a little more explicit as follows. Given a string x consisting of 0s and 1s, we write xk to denote k copies of x concatenated together. We say that string x′ is a repetition of x if it is a prex of xk for some number k. So x′ = 10110110110 is a repetition of x = 101.

We say that a string s is an interleaving of x and y if its symbols can be partitioned into two (not necessarily contiguous) subsequence s′ and s′′ so that s′ is a repetition of x and s′′ is a repetition of y. (So each symbol in s must belong to exactly one of s′ and s′′.) For example, if x = 101 and y = 00, then s = 100010101 is an interleaving of x and y since characters 1, 2, 5, 7, 8, and 9 form 101101a repetition of xand the remaining characters 3, 4, 6 form 000a repetition of y. In terms of our application, x and y are the repeating sequences from the two ships, and s is the signal we are listening to. We want to make sure s unravels into simple repetitions of x and y.

(a) Give an efficient algorithm that takes strings s, x, and y and decides if s is an interleaving of x and y. Derive the computational complexity of your algorithm.

(b) Implement your algorithm above and test its run time to verify your analysis. Remember that CPU time is not a valid measure for testing run time. You must use something such as the number of comparisons.

Reference no: EM131955338

Questions Cloud

Describe the four most important things you have learned : Describe the three or four most important things you have learned about economics this semester.
Duties by asset managers of hedge funds and mutual funds : What could be some of the major violations of fideciary duties by asset managers of hedge funds and mutual funds?
Calculate the equivalent annual cash flow for project : Managers at Acme Doohickey Co. are considering two projects. Calculate the Equivalent Annual Cash Flow (EACF) for Project A.
Define the country dimension of the dataset : Data on energy consumption (measured in million tons of oil equivalent) come from British Petroleum's 2011 Statistical Review of World Energy.
Give an efficient algorithm that takes strings s x and y : Give an efficient algorithm that takes strings s, x and y and decides if s is an interleaving of x and y. Derive the computational complexity of your algorithm.
Comparative study of the various renewable energy system : MHH624684 - Renewable Energy - Develop a prototype model and submit a report Biomass Single Digester Plant for 3 Families, with 10 Cows in Barka Community
What would the breakdown of interest and principal : Payments are to be made monthly. What would the breakdown of interest and principal be during month 20?
Draw the salesperson-buyer communication process : Draw the salesperson-buyer communication process. (you may do this digitally or on paper/pencil - just upload the file after you create it).
Display the data from the frequency distribution : Cloud Data Services (CDS), headquartered in Memphis, provides information technology services, specifically application hosting services in the cloud.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd