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.
And while you're here, why don't you check out our other articles:
Pssst! Most people are coming to this page searching for: 




































