0 votes 0 votes Suppose, we have an array of n elements. find the time complexity to search two elements x, y such that:- a) x+y < 100 b) x+y > 1000 Also, state the algorithm/approach for the same. Algorithms algorithms time-complexity + – Naveen Kumar 3 asked Nov 3, 2018 Naveen Kumar 3 972 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments MiNiPanda commented Nov 4, 2018 reply Follow Share Yes @Prateek right.. 0 votes 0 votes Naveen Kumar 3 commented Nov 4, 2018 reply Follow Share so, for the 1st part also we can apply 2 passes bubble sort(descending order code) & last 2 min. can be checked in (n-1)+(n-2) comparisons. so, O(n). right?? 0 votes 0 votes Prateek Raghuvanshi commented Nov 7, 2018 reply Follow Share Yeah right 0 votes 0 votes Please log in or register to add a comment.