daily gadgets, computers, and electronic news
13/04
2005

#133: The Dole Queue

Sponsored Links

Mari dibahas :)

Fakta:
1. Pelamar berjajar membentuk lingkaran besar.

Every day all dole applicants will be placed in a large circle, facing inwards.

2. Jumlah pelamar sebanyak n. Indeks pelamar dimulai dari 1 dan diakhiri dng n yg ada di sebelah kiri pelamar ke 1.

Someone is arbitrarily chosen as number 1, and the rest are numbered counter-clockwise up to N (who will be standing on 1’s left).

3. a. Petugas I menghitung secara urut dng arah berlawanan dng arah jarum jam sebanyak k pelamar dimulai dari pelamar ke 1.

Starting from 1 and moving counter-clockwise, one labour official counts off k applicants,

b. Petugas II menghitung secara urut dng arah sesuai jarum jam sebanyak m pelamar dimulai dari pelamar ke n.

while another official starts from N and moves clockwise, counting m applicants.

c. Jika petugas I dan II berhenti menghitung pada pelamar yg sama, maka pelamar tersebut diterima menjadi politisi.

The two who are chosen are then sent off for retraining; if both officials pick the same person she (he) is sent off to become a politician.

d. Jika masih ada pelamar, kembali ke 3a dengan perhitungan dimulai dari pelamar di sebelah pelamar yang terpilih pada fakta 3c. Jika pelamar habis, ke fakta 4.

Each official then starts counting again at the next available person and the process continues until no-one is left.

4. Ada kemungkinan seorang pelamar dihitung lebih dari satu kali oleh petugas yang berbeda.

Note that the two victims (sorry, trainees) leave the ring simultaneously, so it is possible for one official to count a person already selected by the other official.

Dari fakta diatas, dpt disimpulkan bahwa data yang digunakan berupa array melingkar atau dapat juga menggunakan tehnik circular queue. Krn datanya tidak terlalu banyak, tidak perlu menggunakan circular link list.

Pages: 1 2 3

#133: The Dole Queue is written by cosa and posted under Programming . If you like it, you might consider subscribing to our feed or receive our latest posts via email. Or else, you could also bookmark it to your favourite social bookmark sites. Further information about this article can be found .

No Comments (leave yours)

No comments yet.

Leave a comment