Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Program to find Big-O notation?

Name: Anonymous 2013-06-17 23:43

Is there a program or a library that I could use to find the O() of an algorithm? For example,

def O_1(n):
    return n

def O_n(n):
    s = 0
    for i in range(0, n):
        s = s + i
    return s
   
def O_n2(n):
    m = 1
    for i in range(1, n + 1):
        for j in range(1, n + 1):
            m = m * i * j
    return m
   
print("O(O_1()) = "  + O(O_1) ) # O(O_1()) = O(1)
print("O(O_n()) = "  + O(O_n) ) # O(O_n()) = O(n)
print("O(O_n2()) = " + O(O_n2) ) # O(O_n2()) = O(n^2)


Is there a library that would work as O(f) should?

Name: Anonymous 2013-06-18 18:42

You know what's more illogical than infinity? Retards who are willing to claim that arithmetic simply breaks down after a while and throw out all what calculus and algebra allows for ideological purity. And if you seriously believe clock arithmetic is the answer, you need to kill yourself. There is absolutely no reason to suppose that that is the case except a blind refusal to accept simple logical deductions in number theory and set theory.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List