log (n!) = Log (n * n (-1) * ... .1) = log (n) + log (n-1) + .... + log (1). So ist es in O (n * logn). Aber ist es auch in groß-Omega (n * logn)? Ich glaube nicht, aber mein automatischer Interviewtest hat es mir so gedacht!Big-Theta funktioniert auch mit Laufzeit in log (n!) Und log (n) + log (n^2)
Protokoll (n) + Protokoll (n^2) = Protokoll (n) + 2 * Protokoll (n) = 3 * Protokoll (n). Also, es ist in, Big-O, Big-Omega und Big-Theta (Log (n)). Aber aus irgendeinem Grund dachte mein automatischer Interviewtest anders.
Ist mein Verständnis korrekt oder ist der automatisierte Test korrekt?
S.S .: Ich hasse automatische Interviewtests!
Ich stimme für das Schließen dieser Frage als Off-Thema, weil es nicht um Programmierung geht (versuchen Sie http://cs.stackexchange.com). –
https://en.wikipedia.org/wiki/Stirling%27s_approximation – WhatsUp