Posts by Bakun • 21 points
2 posts
-
0
votes2
answers165
viewsQ: Algorithm for summation of doubles
Given a vector V of integers, ordered, and a value s, write a complexity algorithm O(n) to compute how many pairs of numbers have sum s. In this vector there may be repeated numbers. Note that if V…
-
1
votes1
answer47
viewsQ: Complexity of simple algorithm
I’m having difficulty in this exercise of complexity of algorithms, someone can give a light? Prove that if f(n) = -n then f(n) is O(1). One idea I had was that for any positive n, f(n) will be less…