Fast Sort Too Hard?

Post Reply
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Fast Sort Too Hard?

Post by adum »

just wondering why nobody has even tried it yet...
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

No, no, it's not too hard. I'm sure it is solvable.
I'm mulling over which algorithm to use here. I thought about radix sort and quicksort.
My analysis shows that both algorithms would take far below 10000 cycles - without using threading.
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

how can you analyze that without really implementing it? just wondering.. (i'm not saying i have any clue of this)
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

I already have quicksort in HVM which should convert easily, I haven't had time though (playing with MythTV...)
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

I'm still trying to grasp how super small quine can be done in 20 cells ><
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

the shvm examples show a very good method to do this :)
hope i didn't tell too much
tog
Posts: 70
Joined: Fri Nov 14, 2008 11:23 am
Location: Germany

Post by tog »

I think it's not too hard. But for me the motivation to start with a king-of-the-hill challenge is relatively low if there is no definite way to go (e.g. the choice of algorithm). You invest quite some time to try and implement some approach, but chances are good that somebody else comes up with a better solution, which renders your solution worthless. Or do I keep the points for setting an old benchmark?

Oh, and I'm still not clear about how to efficiently implement threading (and the proper synchronization of threads) with shvm. That must be the key for fast strrev and will be important for fast sort. It would be really helpful if ShardFire would tell how it's done. :lol:
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

there are 2 ways of syncing the threads known to me
here's one:

Code: Select all

& & & & & <code>
Executes code 32 times but the code is the same for all 32 threads, so no different stackpointer (they are different but cant differ if they execute the same instructions, getThreadID() might change that :P)

The other way I know I won't tell you because it's the better one for this (i'm stuck on my implementation but i'm pretty sure that's the way to go)

good luck on that one :D
Post Reply