際際滷

際際滷Share a Scribd company logo
Nama : Chusnul Khotimah 
Kelas : 2013 B 
NIM : 13030214002 
Soal: 
Buat program untuk mengatur antrian Busway di koridor A, B, C jika pada koridor A hanya mampu digunakan untuk berhenti 2 busway, sedangkan di koridor B 3 busway, di C 2 busway, jika ketal rute busway adalah koridor B, C dan terakhir A, dan jumlah busway adalah 8. 
ALGORITMA QUEUE 
ANTRIAN BUSWAY 
1. Masukkan Input = 8 busway. 
2. Output = 3 koridor. 
3. Urutkan output= B  C  A. 
4. Check B form 1 apakah kosong 
5. Jika kosong => masukkan satu antrian 
6. Check B form 2 apakah kosong 
7. Jika kosong => masukkan satu antrian 
8. Check B form 3 apakah kosong 
9. Jika kosong => masukkan satu antrian 
10. Check B full atau tidak dengan membandingkan jumlah maksimal koridor B dengan input 
11. Pindah koridor C jika B full 
12. Check C form 1 apakah kosong 
13. Jika kosong => masukkan satu antrian 
14. Check C form 2 apakah kosong 
15. Jika kosong => masukkan satu antrian 
16. Check C full atau tidak dengan membandingkan jumlah maksimal koridor C dengan input 
17. Pindah koridor A jika C full 
18. Check A form 1 apakah kosong 
19. Jika kosong => masukkan satu antrian 
20. Check A form 1 apakah kosong 
21. Jika kosong => masukkan satu antrian 
22. Check A full atau tidak dengan membandingkan jumlah maksimal koridor A dengan input
23. Check B  C  A full atau tidak dengan membandingkan jumlah maksimal koridor B  C  A dengan jumlah maksimal input 
24. Remove B form 1 jika B  C  A full 
25. Pindahkan B form 2 ke B form 1 
26. Pindahkan B form 3 ke B form 2 
27. Pindahkan C form 1 ke B form 3 
28. Pindahkan C form 2 ke C form 1 
29. Pindahkan A form 1 ke C form 2 
30. Pindahkan A form 2 ke A form 1 
31. Check Koridor A form 2 kosong 
32. Jika kosong masukkan antrian baru
PSEUDOCODE 
Input: 8 Busway 
Output : 3 koridor (B, C, A) 
Algoritma: 
1. Buat 3 koridor B  C  A 
2. For i = 0 to length of s-1 do { 
3. Check koridor B form 1 
4. If B is empty then masukkan antrian ke B form 1 
5. Else { 
6. Stop 
7. } 
8. Check koridor B form 2 
9. If B is empty then masukkan antrian ke B form 2 
10. Else { 
11. Stop 
12. } 
13. Check koridor B form 3 
14. If B is empty then masukkan antrian ke B form 3 
15. Else { 
16. Stop 
17. } 
18. Check koridor C form 1 
19. If C is empty then masukkan antrian ke C form 1 
20. Else { 
21. Stop 
22. } 
23. Check koridor C form 2 
24. If C is empty then masukkan antrian ke C form 2 
25. Else { 
26. Stop 
27. } 
28. Check koridor A form 1 
29. If A is empty then masukkan antrian ke A form 1 
30. Else { 
31. Stop 
32. } 
33. Check koridor A form 2
34. If A is empty then masukkan antrian ke A form 2 
35. Else { 
36. If koridor full then remove koridor B form 1 
37. Busway pada tempat koridor masing-masing bergeser ke depan 
38. If done then input busway 8 in koridor A form 2 
39. }
Algoritma queue

More Related Content

Featured (20)

2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
Artificial Intelligence, Data and Competition SCHREPEL June 2024 OECD dis...
Artificial Intelligence, Data and Competition  SCHREPEL  June 2024 OECD dis...Artificial Intelligence, Data and Competition  SCHREPEL  June 2024 OECD dis...
Artificial Intelligence, Data and Competition SCHREPEL June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
2024 State of Marketing Report by Hubspot
2024 State of Marketing Report  by Hubspot2024 State of Marketing Report  by Hubspot
2024 State of Marketing Report by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
2024 State of Marketing Report by Hubspot
2024 State of Marketing Report  by Hubspot2024 State of Marketing Report  by Hubspot
2024 State of Marketing Report by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray

Algoritma queue

  • 1. Nama : Chusnul Khotimah Kelas : 2013 B NIM : 13030214002 Soal: Buat program untuk mengatur antrian Busway di koridor A, B, C jika pada koridor A hanya mampu digunakan untuk berhenti 2 busway, sedangkan di koridor B 3 busway, di C 2 busway, jika ketal rute busway adalah koridor B, C dan terakhir A, dan jumlah busway adalah 8. ALGORITMA QUEUE ANTRIAN BUSWAY 1. Masukkan Input = 8 busway. 2. Output = 3 koridor. 3. Urutkan output= B C A. 4. Check B form 1 apakah kosong 5. Jika kosong => masukkan satu antrian 6. Check B form 2 apakah kosong 7. Jika kosong => masukkan satu antrian 8. Check B form 3 apakah kosong 9. Jika kosong => masukkan satu antrian 10. Check B full atau tidak dengan membandingkan jumlah maksimal koridor B dengan input 11. Pindah koridor C jika B full 12. Check C form 1 apakah kosong 13. Jika kosong => masukkan satu antrian 14. Check C form 2 apakah kosong 15. Jika kosong => masukkan satu antrian 16. Check C full atau tidak dengan membandingkan jumlah maksimal koridor C dengan input 17. Pindah koridor A jika C full 18. Check A form 1 apakah kosong 19. Jika kosong => masukkan satu antrian 20. Check A form 1 apakah kosong 21. Jika kosong => masukkan satu antrian 22. Check A full atau tidak dengan membandingkan jumlah maksimal koridor A dengan input
  • 2. 23. Check B C A full atau tidak dengan membandingkan jumlah maksimal koridor B C A dengan jumlah maksimal input 24. Remove B form 1 jika B C A full 25. Pindahkan B form 2 ke B form 1 26. Pindahkan B form 3 ke B form 2 27. Pindahkan C form 1 ke B form 3 28. Pindahkan C form 2 ke C form 1 29. Pindahkan A form 1 ke C form 2 30. Pindahkan A form 2 ke A form 1 31. Check Koridor A form 2 kosong 32. Jika kosong masukkan antrian baru
  • 3. PSEUDOCODE Input: 8 Busway Output : 3 koridor (B, C, A) Algoritma: 1. Buat 3 koridor B C A 2. For i = 0 to length of s-1 do { 3. Check koridor B form 1 4. If B is empty then masukkan antrian ke B form 1 5. Else { 6. Stop 7. } 8. Check koridor B form 2 9. If B is empty then masukkan antrian ke B form 2 10. Else { 11. Stop 12. } 13. Check koridor B form 3 14. If B is empty then masukkan antrian ke B form 3 15. Else { 16. Stop 17. } 18. Check koridor C form 1 19. If C is empty then masukkan antrian ke C form 1 20. Else { 21. Stop 22. } 23. Check koridor C form 2 24. If C is empty then masukkan antrian ke C form 2 25. Else { 26. Stop 27. } 28. Check koridor A form 1 29. If A is empty then masukkan antrian ke A form 1 30. Else { 31. Stop 32. } 33. Check koridor A form 2
  • 4. 34. If A is empty then masukkan antrian ke A form 2 35. Else { 36. If koridor full then remove koridor B form 1 37. Busway pada tempat koridor masing-masing bergeser ke depan 38. If done then input busway 8 in koridor A form 2 39. }