0 votes 0 votes atul_21 asked Nov 13, 2017 atul_21 512 views answer comment Share Follow See all 15 Comments See all 15 15 Comments reply Show 12 previous comments atul_21 commented Nov 14, 2017 reply Follow Share We can directly do it 3* O(n). Which comes to O(n) . . Y we r doing like this? 0 votes 0 votes Harish Kumar 2 commented Nov 14, 2017 reply Follow Share @atul_21 I think if we compare both of these approaches. For 1st => exact complexity => (n + 3log(n)) => roughly O(n). For 2nd => exact => 3n => roughy O(n). So both of the approaches are giving O(n) but we have to choose the closest. Then we should choose 1st approach as n + 3log(n) < 3n. 1 votes 1 votes atul_21 commented Nov 14, 2017 reply Follow Share Thank u @harish 0 votes 0 votes Please log in or register to add a comment.