initalizing a class

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:initalizing a class

Post by Pype.Clicker »

Solar wrote:
If execution time roughly doubles for every order of magnitude of n (like, 100 tasks take twice as long as 10 tasks), that's O(log(n)) - "logarhitmic complexity", and you have one of the best algorhithms around.
err, i'm not sure i agree with you on that point, solar, having T(10)=0.5*T(100)=0.25*T(1000) isn't a logarithmic complexity. Logarithmic complexity says T(100)=T(10)+k and T(1000)=T(10)+2*k, T(10000)=T(10)+3*k, etc.

However, it's unfrequent to have base-10 logarithmic complexity. Base 2 is more common (for binary trees, for instance): everytime your dataset is doubled, your processing time increases by a constant value K.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:initalizing a class

Post by Solar »

Uhm... you got me there. Must have been my breakfast consisting of half a dozen Aspirin and a cup of tea. ;-)
Every good solution is obvious once you've found it.
Post Reply