Given a positive integer S and an array A of n positive integers, now to provide a boolean answer to the question whether there exist two distinct elements of A whose sum is exactly S, the time required is :

Note: Extra space should not be used

1
O(n3)
2
O(log n)
3
θ(n2)
4
θ(n log n)

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation