in Algorithms
542 views
0 votes
0 votes

in Algorithms
by
542 views

4 Comments

We can directly do it 3* O(n).  Which comes to O(n) . . Y we r doing like this?
0
0
@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
1
Thank u @harish
0
0

Please log in or register to answer this question.