|
-
Mar 5th, 2005, 05:16 AM
#1
Thread Starter
New Member
-
Mar 5th, 2005, 01:06 PM
#2
transcendental analytic
Re: turing machine computes a function in time..
That's the big O notation, which exposes only the most essential characeteristics of the computation time, as a function of the amount of elements n you are operating on.
for instance, if an algorithm takes 5n*log2(6n)+4 time, then T=n*log(n) in O(T(n)), you usually see this notation: O(n*log(n)) when looking at for instance sorting algorithms.
When you do a big O notation, sort out all constants, then sort out all except the most significant term, i.e. the one that grows fastest toward infinity when n increases, for instance n^4 wins against n^3, and 2^n wins against n^4 (x^y symbolising x to the power of y). If you are unsure which grows fastest then you can always test them with big enough numbers, but its better to memorize the order in which the functions grows. Another way is dividing one with the other, and if the function tends toward 0 when n grows, then the denominator wins otherwise the numerator.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|