Результаты поиска по запросу "complexity-theory"

30 ответов

This type of algorithm is described as O(log N). The iterative halving of data sets described in the binary search example produces a growth curve that peaks at the beginning and slowly flattens out as the size of the data sets increase e.g. an input data set containing 10 items takes one second to complete, a data set containing 100 items takes two seconds, and a data set containing 1000 items will take three seconds. Doubling the size of the input data set has little effect on its growth as after a single iteration of the algorithm the data set will be halved and therefore on a par with an input data set half the size. This makes algorithms like binary search extremely efficient when dealing with large data sets.

предпочел как можно меньше формального определения и простую математику.

30 ответов

Есть ли O (1 / n) алгоритмы?

Есть ли O (1 / n) алгоритмы? Или что-нибудь еще, что меньше, чем O (1)?

30 ответов

Как найти наименьшего общего предка двух узлов в любом двоичном дереве?

Двоичное дерево здесь не обязательно может быть двоичным деревом поиска. Структура может быть принята как - struct node { int data; struct node *left; struct node *right; };Максимальное решение, которое я мог решить с другом, было что-то в этом ...

ТОП публикаций