Напишите код, соответствующий определенной Big-O-Notation.C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Напишите код, соответствующий определенной Big-O-Notation.

Сообщение Anonymous »


Our class was challenged by a professor at uni that if we were able to find a algorithm that fittingly describes the following Big-O-Notation, we'd instantly pass his class. I wanted to ask if any of you know how this could be done since I've been struggling to make it work without just simplifying it. (Could be any language, i chose c++ for my example)
O(4n · (-2 + 3n) · (n - log(n)) / n) = ?
Simplifying it often gave me either O(n^2) or O(n^3) which would be easy enough to implement but i feel like is not the goal of the challenge. I've tried directly changing each part into algorithm logic like this:

#include #include void Algorithm(int n) { for (int i = 1; i

Источник: https://stackoverflow.com/questions/780 ... o-notation
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»