Algorithm to decide whether there are 2 integers sum equal x

Assignment Help Data Structure & Algorithms
Reference no: EM13944157

Suppose you are given a set P of integers and another integer x. We wish to use a O(n*lg n) algorithm to decide whether there are 2 integers in P whose sum equals to x. Show your algorithm. You can use pseudo code or verbose description to explain your algorithm.

If you need to use any well known standard algorithm in your solution, you need not give details of that, just mention how that is helping you in devising solution for the given problem.

Note that there is no restriction on integers in set P and integer x, that is, we are not restricting ourselves to positive or negative integers.

Reference no: EM13944157

Questions Cloud

Probability distribution for the number of times : An office manager has several computers running distributed programs. Because of the demands on the system, the machines may crash at various times during the day and require a hard reset. The probability distribution for the number of times a ran..
What is the forecast cash position of jethro : What is the forecast cash position of Jethro Turnbull at the end of the budget year, assuming a current bank overdraft of £15,000?
Means and proportions for several groups : A marketing study conducts 60 significance tests about means and proportions for several groups. Of them, 3 tests are statistically significant at the 0.05 level. The study's final report stresses only the tests with significant results, not menti..
Modelling equation for tank height assuming : In Number 1 it was assumed that the input and output flow rates could be independently varied. Consider a situation in which the outlet flow rate is a function of the height of liquid in the tank. Write the modelling equation for tank height assum..
Algorithm to decide whether there are 2 integers sum equal x : Note that there is no restriction on integers in set P and integer x, that is, we are not restricting ourselves to positive or negative integers.
Social security long enough to be fully insured : Kate is a single parent who earns $40,000 per year. Her household expense are $28,000 per year.  If she were to die, she estimates that the costs of her death would be $10,000.  She has not participated in Social Security long enough to be fully insu..
Compare scholastic, and associationist viewpoints of reality : What are your thoughts on the content of this discussion below. How does this person interpret reality? Do you agree or disagree?
Discuss and define modigliani and miller capital structure : "Discuss and define Modigliani and Miller Capital structure irrelevance theory proposition 1 and 2 and state the difference it makes with tax and without tax "
Role of an entrepreneur of an organisation : Assume the role of an entrepreneur of an organisation that sells goods or services to the public. You would like to expand without the capital costs of establishing additional retail outlets and hay have decided to explore the possibility of expan..

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