When is Big-O = x classified as ineffective?

Suppose we have a problem that we have implemented using algorithm X with O(n)or O(log n)or etc.... When is the value nlarge enough for us to consider an alternative implementation? Let's see if I can explain myself a little better.

When n = 10000

O (n ^ 2) = 100,000,000

O (n) = 10,000

O (Log n) = 4

.,.

Obviously, the best algorithm will be with the lowest "Big-o".

So, let's say we are sorting an array of length 5 using sorting of bubbles, the result is 25, which is not so bad. But when the result of the O-record is so great that in reality we must use a different implementation.

+3
source share
4 answers

.

, , .

+4

Big O , ; , O (n ^ 2), n 12, , , O (n ^ 2) "" .

O (n ^ 2) " "; O (n log n) "yay, ". , , , , , .

+1

, , Big-O , , .

0

alt text alpha = 1.

0

Source: https://habr.com/ru/post/1776594/


All Articles