Monday, November 17, 2008

Algorithm paling keren zaman kini

Zero Sort ( 0 )
kecepatan : O(1) !! WOOOW, sebelumnya, sort paling cepet O(N log(N)), sekarang O(1)!!
kondisi : the array must already be sorted...

4 Leaf Clover Search ( Luk )
kecepatan : O(1) !! WOOOW
kondisi : random pilih index, bawa 4 leaf clover, hoki langsung ketemu valuenya

kalo anda komentar : ( WtH, apaan tuh ngandalin luck ! )
saya jawab : ok2, saya kasih search yg lebih hebat

Ultima Search! ( Uz )
kecepatan : O(1) !!
kondisi : the searched value must be in the first index!

kalo anda komentar : ( WTF, kondisinya kapan terpenuhi woii!! )
saya jawab :, ok2, saya kasih yang kondisinya tidak banyak cincong!

Light Checking ( LCz ) -> to check wether a value is present in the array or not
kecepatan :O(1)!!
kondisi : None

Pascal Example of Light Checking ( LCz ) algorithm

function LCz(a:array of integer,src:integer):string
begin
if a[0] = src then LCz := "0" else LCz:= "I don't know";
end;

, O(1)!!! wowwww!

Shortest Path Algorithm :
Djistra? N Log ( N ), with worst case N*N? TRASHH!!!, USE THIS ALGORITHM

Teleportation Spell ( TSl )
kecepatan : O(N)!!!

Pascal Example of Teleportation Spell ( TSl ) algorithm

a[i,1] : koordinat x kota awal
a[i,2] : koordinat y kota awal

a[j,1] : koordinat x kota tujuan
a[j,2] : koordinat y kota tujuan

begin
//baca input

writeln(sqrt((a[i,1]-a[j,1])^2+(a[i,2]-a[j,2])^2)));
end;

( intinya jalan aja lurus dari kota awal mpe kota tujuan, susah amat, yea!!! )

0 comments: