SlideShare a Scribd company logo
Pengantar Algoritma
Utami Aryanti ST.,M.Kom
Algoritma dan Pemrograman
• Program komputer ditulis melalui proses analisis dan perancangan
yang cermat.
• Sebuah program komputer pada dasarnya mengimplementasikan
suatu algoritma.
• Dengan kata lain, algoritma adalah ide dibalik setiap program
komputer.
Masalah
• Masalah adalah pertanyaan atau tugas yang kita cari
jawabannya[NEA96].
Contoh masalah :
Diberikan setumpuk kartu pasien di sebuah klinik yang tersusun acak.
Setiap kartu memiliki nomor registrasi pasien. Bagaimana mengurutkan
kartu-kartu tadi berdasarkan nomor urut pasien sehingga tersusun
dengan nomor kecil diatas dan nomor besar dibawah?
Jawaban dari masalah ini adalah mengurutkan kartu pasien
berdasarkan nomor kartu dari nomor kecil ke besar.
Algoritma (1)
Beberapa definisi algoritma :
• Algoritma adalah deretan langkah-langkah komputasi yang
mentransformasikan data masukan menjadi keluaran[COR92]
• Algoritma adalah deretan instruksi yang jelas untuk memecahkan
masalah, yaitu untuk memperoleh keluaran yang diinginkan dari
suatu masukan dalam jumlah waktu yang terbatas.
Berdasarkan definisi di atas, maka dapat disimpulkan bahwa :
• Algoritma adalah urutan langkah-langkah untuk memecahkan suatu
masalah komputasi untuk memperoleh keluaran (output) yang
diinginkan.
Algoritma (2)
Mari kita tinjau kembali masalah mengurutkan kartu. Jika kita mempunyai
setumpuk kartu yang berjumlah n=10 buah, maka langkah-langkah
(algoritma) pengurutan 10 buah kartu dapat di tuliskan sebagai berikut :
1. Cari kartu dengan nomor terkecil
2. Tempatkan kartu tersebut pada posisi paling atas
3. Cari kartu dengan nomor terkecil berikutnya
4. Tempatkan kartu tersebut di bawah kartu pertama
5. Cari kartu dengan nomor terkecil berikutnya
6. Tempatkan kartu tersebut di bawah kartu kedua
…
xx. Tempatkan kartu tersebut di bawah kartu kedelapan
(Tersisa satu kartu lagi, tetapi tidak perlu di urutkan.
8 7 1 2 6 5 4 3 10 9
Kartu Sebelum diurut :
Langkah 1
8 7 1 2 6 5 4 3 10 9
Nomor terkecil
Langkah 2
1 8 7 2 6 5 4 3 10 9
Pindahkan ke posisi paling depan
Langkah 3
1 8 7 2 6 5 4 3 10 9
Nomor terkecil selanjutnya
Langkah 4
1 2 8 7 6 5 4 3 10 9
Pindahkan ke posisi dibelakang kartu pertama
Perhatikan !
Dalam rangkaian langkah diatas terjadi dua pengulangan langkah penting, yaitu : 1.Cari kartu dengan nomor terkecil, 2.Tempatkan kartu tersebut pada posisi
paling atas. Kedua langkah ini diulang sampai kartu tersisa 1 (berarti jumlah pengulangannya sebanyak n-1 yaitu 10-1=9 pengulangan. Langkah-langkah yang
ditulis diatas itulah yang disebut algoritma
Tugas
• Lanjutkan langkah-langkah mengurutkan kartu pada slide
sebelumnya, sampai semua kartu terurut dari nomor terkecil ke
nomor terbesar.
• Tugas dikumpulkan paling lambat hari jumat jam 12.00 melalui WA.
Pembahasan Tugas
8 7 1 2 6 5 4 3 10 9
Langkah 1
8 7 1 2 6 5 4 3 10 9
Nomor terkecil
Langkah 2
1 8 7 2 6 5 4 3 10 9
Pindahkan ke posisi paling depan
Langkah 3
1 8 7 2 6 5 4 3 10 9
Nomor terkecil selanjutnya
Langkah 4
1 2 8 7 6 5 4 3 10 9
Pindahkan ke posisi dibelakang kartu pertama
Langkah 5
1 2 8 7 6 5 4 3 10 9
Nomor terkecil selanjutnya
Langkah 6
1 2 3 8 7 6 5 4 10 9
Pindahkan ke posisi dibelakang kartu kedua
Langkah 7
Nomor terkecil selanjutnya
Langkah 8
Pindahkan ke posisi dibelakang kartu ketiga
1 2 3 8 7 6 5 4 10 9
1 2 3 4 8 7 6 5 10 9
Langkah 9
Nomor terkecil selanjutnya
Langkah 10
1 2 3 4 5 8 7 6 10 9
1 2 3 4 8 7 6 5 10 9
Pindahkan ke posisi dibelakang kartu keempat
Langkah 11
Nomor terkecil selanjutnya
Langkah 12
1 2 3 4 5 6 8 7 10 9
Pindahkan ke posisi dibelakang kartu kelima
1 2 3 4 5 8 7 6 10 9
Nomor terkecil selanjutnya
1 2 3 4 5 6 7 8 10 9
1 2 3 4 5 6 8 7 10 9
Pindahkan ke posisi dibelakang kartu keenam
Langkah 13
Langkah 14
Nomor terkecil selanjutnya
1 2 3 4 5 6 7 8 10 9
1 2 3 4 5 6 7 8 10 9
Pindahkan ke posisi dibelakang kartu ketuju
Langkah 15
Langkah 16
Nomor terkecil selanjutnya
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 10 9
Pindahkan ke posisi dibelakang kartu kedelapan
Langkah 17
Langkah 18
Nomor terbesar tidak dilakukan
pencarian lagi karena sudah ada di
urutan paling terakhir, sehingga
langkah 1&2 diulang sebanyak 10-1=9x

More Related Content

Recently uploaded

PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptxPRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
muhammadyudiyanto55
 
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docx
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docxForm B1 Rubrik Observasi Presentasi Visi Misi -1.docx
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docx
EkoPutuKromo
 
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
RinawatiRinawati10
 
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docxForm B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
EkoPutuKromo
 
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docxRUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
kinayaptr30
 
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptxSEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
bobobodo693
 
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdfMATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
ssuser289c2f1
 
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
haryonospdsd011
 
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptxJuknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
mattaja008
 
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBIVISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
gloriosaesy
 
Seminar: Sekolah Alkitab Liburan (SAL) 2024
Seminar: Sekolah Alkitab Liburan (SAL) 2024Seminar: Sekolah Alkitab Liburan (SAL) 2024
Seminar: Sekolah Alkitab Liburan (SAL) 2024
SABDA
 
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdfNUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
DataSupriatna
 
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERILAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
PURWANTOSDNWATES2
 
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdfPETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
Hernowo Subiantoro
 
Program Kerja Kepala Sekolah 2023-2024.pdf
Program Kerja Kepala Sekolah 2023-2024.pdfProgram Kerja Kepala Sekolah 2023-2024.pdf
Program Kerja Kepala Sekolah 2023-2024.pdf
erlita3
 
Koneksi Antar Materi Modul 1.4.ppt x
Koneksi Antar Materi Modul 1.4.ppt           xKoneksi Antar Materi Modul 1.4.ppt           x
Koneksi Antar Materi Modul 1.4.ppt x
johan199969
 
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdfNajwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
naqarin2
 
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docxRUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
lastri261
 
Kisi-kisi soal pai kelas 7 genap 2024.docx
Kisi-kisi soal pai kelas 7 genap 2024.docxKisi-kisi soal pai kelas 7 genap 2024.docx
Kisi-kisi soal pai kelas 7 genap 2024.docx
irawan1978
 
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docxINSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
lindaagina84
 

Recently uploaded (20)

PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptxPRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
PRESENTASI OBSERVASI PENGELOLAAN KINERJA KEPALA SEKOLAH.pptx
 
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docx
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docxForm B1 Rubrik Observasi Presentasi Visi Misi -1.docx
Form B1 Rubrik Observasi Presentasi Visi Misi -1.docx
 
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
813 Modul Ajar KurMer Usaha, Energi, dan Pesawat Sederhana (2).docx
 
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docxForm B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
Form B8 Rubrik Refleksi Program Pengembangan Kompetensi Guru -1.docx
 
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docxRUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
 
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptxSEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
SEMINAR PPG DAN PPL ppg prajabatan 2024.pptx
 
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdfMATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
MATERI SOSIALISASI PPDB JABAR- 4PAN052024.pdf
 
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
Dokumen Rangkuman Kehadiran Guru ini dipergunakan sebagai bukti dukung yang w...
 
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptxJuknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
Juknis Pengisian Blanko Ijazah 2024 29 04 2024 Top.pptx
 
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBIVISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
VISI MISI KOMUNITAS BELAJAR SDN 93 KOTA JAMBI
 
Seminar: Sekolah Alkitab Liburan (SAL) 2024
Seminar: Sekolah Alkitab Liburan (SAL) 2024Seminar: Sekolah Alkitab Liburan (SAL) 2024
Seminar: Sekolah Alkitab Liburan (SAL) 2024
 
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdfNUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
NUMERASI KOMPETENSI PENDIDIK TAHAP CAKAP DAN MAHIR.pdf
 
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERILAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
LAPORAN EKSTRAKURIKULER SEKOLAH DASAR NEGERI
 
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdfPETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
PETUNJUK TEKNIS PPDB JATIM 2024-sign.pdf
 
Program Kerja Kepala Sekolah 2023-2024.pdf
Program Kerja Kepala Sekolah 2023-2024.pdfProgram Kerja Kepala Sekolah 2023-2024.pdf
Program Kerja Kepala Sekolah 2023-2024.pdf
 
Koneksi Antar Materi Modul 1.4.ppt x
Koneksi Antar Materi Modul 1.4.ppt           xKoneksi Antar Materi Modul 1.4.ppt           x
Koneksi Antar Materi Modul 1.4.ppt x
 
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdfNajwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
Najwa Qarina_2021 B_Analisis Kritis Jurnal.pdf
 
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docxRUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
RUBRIK OBSERVASI KINERJA KEPALA SEKOLAH.docx
 
Kisi-kisi soal pai kelas 7 genap 2024.docx
Kisi-kisi soal pai kelas 7 genap 2024.docxKisi-kisi soal pai kelas 7 genap 2024.docx
Kisi-kisi soal pai kelas 7 genap 2024.docx
 
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docxINSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
INSTRUMEN PENILAIAN PRAKTIK KINERJA KS Dok Rating Observasi (1).docx
 

Featured

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
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

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
 
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
 
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
 
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
 
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
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
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
 
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)
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Pengantar Algoritma.pptx

  • 2. Algoritma dan Pemrograman • Program komputer ditulis melalui proses analisis dan perancangan yang cermat. • Sebuah program komputer pada dasarnya mengimplementasikan suatu algoritma. • Dengan kata lain, algoritma adalah ide dibalik setiap program komputer.
  • 3. Masalah • Masalah adalah pertanyaan atau tugas yang kita cari jawabannya[NEA96]. Contoh masalah : Diberikan setumpuk kartu pasien di sebuah klinik yang tersusun acak. Setiap kartu memiliki nomor registrasi pasien. Bagaimana mengurutkan kartu-kartu tadi berdasarkan nomor urut pasien sehingga tersusun dengan nomor kecil diatas dan nomor besar dibawah? Jawaban dari masalah ini adalah mengurutkan kartu pasien berdasarkan nomor kartu dari nomor kecil ke besar.
  • 4. Algoritma (1) Beberapa definisi algoritma : • Algoritma adalah deretan langkah-langkah komputasi yang mentransformasikan data masukan menjadi keluaran[COR92] • Algoritma adalah deretan instruksi yang jelas untuk memecahkan masalah, yaitu untuk memperoleh keluaran yang diinginkan dari suatu masukan dalam jumlah waktu yang terbatas. Berdasarkan definisi di atas, maka dapat disimpulkan bahwa : • Algoritma adalah urutan langkah-langkah untuk memecahkan suatu masalah komputasi untuk memperoleh keluaran (output) yang diinginkan.
  • 5. Algoritma (2) Mari kita tinjau kembali masalah mengurutkan kartu. Jika kita mempunyai setumpuk kartu yang berjumlah n=10 buah, maka langkah-langkah (algoritma) pengurutan 10 buah kartu dapat di tuliskan sebagai berikut : 1. Cari kartu dengan nomor terkecil 2. Tempatkan kartu tersebut pada posisi paling atas 3. Cari kartu dengan nomor terkecil berikutnya 4. Tempatkan kartu tersebut di bawah kartu pertama 5. Cari kartu dengan nomor terkecil berikutnya 6. Tempatkan kartu tersebut di bawah kartu kedua … xx. Tempatkan kartu tersebut di bawah kartu kedelapan (Tersisa satu kartu lagi, tetapi tidak perlu di urutkan. 8 7 1 2 6 5 4 3 10 9 Kartu Sebelum diurut : Langkah 1 8 7 1 2 6 5 4 3 10 9 Nomor terkecil Langkah 2 1 8 7 2 6 5 4 3 10 9 Pindahkan ke posisi paling depan Langkah 3 1 8 7 2 6 5 4 3 10 9 Nomor terkecil selanjutnya Langkah 4 1 2 8 7 6 5 4 3 10 9 Pindahkan ke posisi dibelakang kartu pertama Perhatikan ! Dalam rangkaian langkah diatas terjadi dua pengulangan langkah penting, yaitu : 1.Cari kartu dengan nomor terkecil, 2.Tempatkan kartu tersebut pada posisi paling atas. Kedua langkah ini diulang sampai kartu tersisa 1 (berarti jumlah pengulangannya sebanyak n-1 yaitu 10-1=9 pengulangan. Langkah-langkah yang ditulis diatas itulah yang disebut algoritma
  • 6. Tugas • Lanjutkan langkah-langkah mengurutkan kartu pada slide sebelumnya, sampai semua kartu terurut dari nomor terkecil ke nomor terbesar. • Tugas dikumpulkan paling lambat hari jumat jam 12.00 melalui WA.
  • 7. Pembahasan Tugas 8 7 1 2 6 5 4 3 10 9 Langkah 1 8 7 1 2 6 5 4 3 10 9 Nomor terkecil Langkah 2 1 8 7 2 6 5 4 3 10 9 Pindahkan ke posisi paling depan Langkah 3 1 8 7 2 6 5 4 3 10 9 Nomor terkecil selanjutnya Langkah 4 1 2 8 7 6 5 4 3 10 9 Pindahkan ke posisi dibelakang kartu pertama Langkah 5 1 2 8 7 6 5 4 3 10 9 Nomor terkecil selanjutnya Langkah 6 1 2 3 8 7 6 5 4 10 9 Pindahkan ke posisi dibelakang kartu kedua Langkah 7 Nomor terkecil selanjutnya Langkah 8 Pindahkan ke posisi dibelakang kartu ketiga 1 2 3 8 7 6 5 4 10 9 1 2 3 4 8 7 6 5 10 9 Langkah 9 Nomor terkecil selanjutnya Langkah 10 1 2 3 4 5 8 7 6 10 9 1 2 3 4 8 7 6 5 10 9 Pindahkan ke posisi dibelakang kartu keempat Langkah 11 Nomor terkecil selanjutnya Langkah 12 1 2 3 4 5 6 8 7 10 9 Pindahkan ke posisi dibelakang kartu kelima 1 2 3 4 5 8 7 6 10 9 Nomor terkecil selanjutnya 1 2 3 4 5 6 7 8 10 9 1 2 3 4 5 6 8 7 10 9 Pindahkan ke posisi dibelakang kartu keenam Langkah 13 Langkah 14 Nomor terkecil selanjutnya 1 2 3 4 5 6 7 8 10 9 1 2 3 4 5 6 7 8 10 9 Pindahkan ke posisi dibelakang kartu ketuju Langkah 15 Langkah 16 Nomor terkecil selanjutnya 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 10 9 Pindahkan ke posisi dibelakang kartu kedelapan Langkah 17 Langkah 18 Nomor terbesar tidak dilakukan pencarian lagi karena sudah ada di urutan paling terakhir, sehingga langkah 1&2 diulang sebanyak 10-1=9x