![]() |
Dunno but it seems to show up in every single one of these exercises :/
|
Quote:
hehe |
Quote:
For example, the quicksort algorithm is O(n log n) [for every item to sort, it takes log base 2 of n loops to find its place]. |
Quote:
EDIT: I fixed mine, it wins now. It goes something like this: PHP Code:
|
Well, after having this explained to me I'm kinda ticked that this wasn't even pointed out from the start.
If I were to optimize my script I would have used Drakilor's method which for me to do now would just be copying. |
PHP Code:
Example1: PHP Code:
PHP Code:
|
Quote:
|
Quote:
@Chris, you started your algorithm 355 years into the future? Also you fail at subtracting. :p e: Here are exact (well, kinda) loop count functions for the algorithms (n=str.length()): Inverness: http://img258.imageshack.us/img258/2...b9bf3c1nt8.png Where epsilon (the E) is a number representative of the other loops that lead to 'continue;'. The script could be adjusted slightly to eliminate this term. DrakilorP2P: http://img87.imageshack.us/img87/353...66d612ekl4.png It should be pretty obvious where I get the O(n^2) from... |
Quote:
|
Quote:
You also have yet to point out to others what functions they should be avoiding and why. Quote:
You need to come down to the level of us mortals. |
Quote:
Quote:
Quote:
Quote:
I don't see what you're so upset about, you made a good contribution. |
I bet I could beat my previous time of 12 seconds by triggering my web server which would use awesome fast PHP to find patterns, then return them to Graal.
Slower than some, but surely faster than 12 seconds? |
I'm upset because you're evaluating based on this big-O thing but didn't state that in the first place and explain it.
Anyhow, if the goal is "to make this as efficient as possible with graal script" then you should be measuring based on time to complete instead of your big-O thing since the hard-coded functions do have a notable speed difference. |
If it's going to be based on time they would all have to be done on one computer instead of us each executing them as our computer speeds can change the time.
|
Quote:
And could you "pfa" get yourself a new account or put the proper way to address you in your signature or something? I can't go calling you Tolnaftate2004 or a shortened version of it and I'm not sure if I should be calling you "pfa" either and didn't even know about that until the announcement that you became GST. |
| All times are GMT +2. The time now is 03:33 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.