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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:00, Wolfie215
Which of the following is a way that advancements in technology improve humans' ability to measure air quality and protect human health? a. air quality data gathered by new instruments can be used to reduce exposure to pollutants. b. new technologies enable natural and human-made pollution sources to be located and monitored. c. air quality data gathered by new instruments can be used to predict trends in pollution over time. d. new technologies allow governments to make informed decisions about the regulation of pollution. (choose more than one)
Answers: 2
image
Computers and Technology, 22.06.2019 11:40, malibu777
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, jalaholmes2027
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
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 in other subjects: