edited by
1,232 views
4 votes
4 votes

Given an array which contains both positive and negative integers in it and asked to design an algorithm to find the maximum sum which does not contain two consecutive numbers.What is the time comlexity of efficient algorithm
A) Θ(nlogn)
B) Θ(n)
C) Θ(n2)
D) Θ(n2logn) 

edited by

1 Answer

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
3
shipra tressa asked Jul 17, 2018
1,467 views
Given a sequence of n real numbers a1,a2,a3...an then to find contiguous subsequence ai,ai+1,ai+2....aj. Such that it's sum is maximum. How much time the above problem wi...