subject

You are given a set S = {s1,s2,...,sn} of n distinct natural numbers such that 0 ≤ si ≤ 100n. Your task is to design an algorithm that takes as input S and a natural number N, and outputs True if the equation si + sj + sk = N has at least one solution, and return False otherwise. There is a simple solution that runs in O(n3) time, but I hope you improve that time using FFT. Example: For N = 6 and S = {1,2,3,5,10} your design should output True since 1+2+3 = 6. For N = 20 and the same set S the answer should be True again since 5+5+10 = 20 (yes, you can have si = sj = sk!) but for N = 19 the answer is False since no three numbers add up to 19.
You can use FFT as a black box. Explicitly write the polynomials you will use as input for FFT and explain how you use the output to answer your problem. State and justify the running time of your algorithm.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Is the following sentence true or false? during meiosis, the two alleles for each gene stay together.
Answers: 3
question
Computers and Technology, 23.06.2019 20:30
If an appliance consumes 500 w of power and is left on for 5 hours, how much energy is used over this time period? a. 2.5 kwh b. 25 kwh c. 250 kwh d. 2500 kwh
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
You know the right answer?
You are given a set S = {s1,s2,...,sn} of n distinct natural numbers such that 0 ≤ si ≤ 100n. Yo...
Questions
question
Mathematics, 21.06.2021 16:40
question
Mathematics, 21.06.2021 16:40
question
English, 21.06.2021 16:40
question
History, 21.06.2021 16:40
question
Mathematics, 21.06.2021 16:40
Questions on the website: 13722361