SlideShare a Scribd company logo
Adam Mukharil Bachtiar
English Class
Informatics Engineering 2011
Algorithms and Programming
Sorting
Steps of the Day
Let’s Start
Definition of
Sorting
Bubble Sort Selection
Sort
Definition of Sorting
All About Sorting
WhatisSorting
Process that arranges random data into sorted
data. Data can be sorted into ascending or
descending.
AlgorithmsofSorting
• Bubble Sort
• Selection Sort
Bubble Sort
Definition and Structures of Bubble Sort
WhatisBubbleSort
• Sorting algorithm which was inspired by
bubble soap.
• Comparing element of array (i) with next
element of it (i+1).
• If i is bigger than i+1 then swap value of
each element.
Ilustration of Bubble Sort
Array: 5 3 7 9 2 3 6 4 3 1
L. 1 3 5 7 2 3 6 4 3 1 9
L. 2 3 5 2 3 6 4 3 1 7 9
L. 3 3 2 3 5 4 3 1 6 7 9
L. 4 2 3 3 4 3 1 5 6 7 9
L. 5 2 3 3 3 1 4 5 6 7 9
L. 6 2 3 3 1 3 4 5 6 7 9
L. 7 2 3 1 3 3 4 5 6 7 9
L. 8 2 1 3 3 3 4 5 6 7 9
L. 9 1 2 3 3 3 4 5 6 7 9
Process of Bubble Sort (Ascending)
This is an array that will be sorted in Ascending way:
6 3 9 1 5
Step 1 : 6 3 9 1 5
6 3 9 1 5
6 3 1 9 5
6 1 3 9 5
1 6 3 9 5
j
j
j
j
Process of Bubble Sort (Ascending)
Step 2 : 1 6 3 9 5
1 6 3 5 9
1 6 3 5 9
1 3 6 5 9
j
j
j
Process of Bubble Sort (Ascending)
Step 3 : 1 3 6 5 9
1 3 6 5 9
1 3 5 6 9
Step 4 : 1 3 5 6 9
1 3 5 6 9
Array after sorted in ascending ways:
1 3 5 6 9
j
j
j
General Format for Bubble Sort Ascending
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Procedure BubbleSortAsc(I/O nama_var_array : nama_tipe_array,
Input N : integer)
{I.S. : array[1..N] sudah terdefinisi}
{F.S. : menghasilkan array[1..N] yang tersusun secara ascending}
Kamus:
i, j : integer
temp : tipedata
Algoritma:
for i  1 to N-1 do
for j  n downto i+1 do
if(nama_var_array[j] < nama_var_array[j-1])
then
temp  nama_var_array[j]
nama_var_array[j]  nama_var_array[j-1]
nama_var_array[j-1]  temp
endif
endfor
endfor
EndProcedure
Process of Bubble Sort (Descending)
This is an array that will be sorted in Descending way :
6 3 9 1 5
Step 1 : 6 3 9 1 5
6 3 9 1 5
6 9 3 1 5
6 9 3 1 5
6 9 3 5 1
j
j
j
j
Process of Bubble Sort (Descending)
Step 2 : 6 9 3 5 1
9 6 3 5 1
9 6 3 5 1
9 6 5 3 1
j
j
j
Process of Bubble Sort (Descending)
Step 3 : 9 6 5 3 1
9 6 5 3 1
9 6 5 3 1
Step 4 : 9 6 5 3 1
9 6 5 3 1
Array after sorted in descending ways:
9 6 5 3 1
j
j
j
General Format for Bubble Sort Descending
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Procedure BubbleSortDesc (I/O nama_var_array : nama_tipe_array,
Input N : integer)
{I.S. : array[1..N] sudah terdefinisi}
{F.S. : menghasilkan array[1..N] yang tersusun secara descending}
Kamus:
i,j : integer
temp : tipedata
Algoritma:
for i  1 to N-1 do
for j  1 to (N - i) do
if(nama_var_array[j] < nama_var_array[j+1])
then
temp  nama_var_array[j]
nama_var_array[j]  nama_var_array[j+1]
nama_var_array[j+1]  temp
endif
endfor
endfor
EndProcedure
Selection Sort
Definition and Structures of Selection Sort
WhatisSelectionSort
Sorting algorithm that arranges random data
by selecting the biggest data or the smallest
one.
MethodsinSelectionSort
• Maximum Sort
• Minimum Sort
Process of Maximum Sort (Ascending)
This is an array that will be sorted in Ascending way :
6 3 9 1 5
Step 1 : 6 3 9 1 5
6 3 9 1 5
6 3 9 1 5
6 3 9 1 5
6 3 9 1 5
6 3 5 1 9
j
j
j
jmax
max
max
max
max j
Process of Maximum Sort (Ascending)
Step 2 : 6 3 5 1 9
6 3 5 1 9
6 3 5 1 9
6 3 5 1 9
1 3 5 6 9
j
j
jmax
max
max
max j
Process of Maximum Sort (Ascending)
Step 3 : 1 3 5 6 9
1 3 5 6 9
1 3 5 6 9
1 3 5 6 9
Step 4 : 1 3 5 6 9
1 3 5 6 9
Array after sorted in descending way:
1 3 5 6 9
j
j
max
max
max
max
j
j
max
General Format for Maximum Sort Ascending
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Procedure MaximumSortAsc(I/O nama_var_array : nama_tipe_array,
Input N : integer)
{I.S. : array [1..N] sudah terdefinisi}
{F.S. : menghasilkan array [1..N] yang tersusun secara ascending}
Kamus:
i, j, max, x : integer
temp : tipedata
Algoritma:
x  n
for i  1 to N-1 do
max  1
for j  2 to x do
if(nama_var_array[j] > nama_var_array[max])
then
max  j
endif
endfor
temp  nama_var_array[max]
nama_var_array[max]  nama_var_array[j]
nama_var_array[j]  temp
x  x - 1
endfor
EndProcedure
General Format for Minimum Sort Ascending
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Procedure MinimumSortAsc(I/O nama_var_array : nama_tipe_array,
Input N : integer)
{I.S. : array[1..n] sudah terdefinisi}
{F.S. : menghasilkan array [1..n] yang tersusun secara ascending}
Kamus:
i, j, min : integer
temp : tipedata
Algoritma:
for i  1 to (N – 1) do
min  i
for j  i+1 to N do
if(nama_var_array[j] < nama_var_array[min])
then
min  j
endif
endfor
temp  nama_var_array[min]
nama_var_array[min]  nama_var_array[i]
nama_var_array[i]  temp
endfor
EndProcedure
Contact Person:
Adam Mukharil Bachtiar
Informatics Engineering UNIKOM
Jalan Dipati Ukur Nomor. 112-114 Bandung 40132
Email: adfbipotter@gmail.com
Blog: http://adfbipotter.wordpress.com
Copyright © Adam Mukharil Bachtiar 2011
Ad

More Related Content

What's hot (20)

Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
Amrinder Arora
 
Merge sort algorithm power point presentation
Merge sort algorithm power point presentationMerge sort algorithm power point presentation
Merge sort algorithm power point presentation
University of Science and Technology Chitttagong
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
Soujanya V
 
LR-Parsing.ppt
LR-Parsing.pptLR-Parsing.ppt
LR-Parsing.ppt
BapanKar2
 
Algorithm and Programming (Searching)
Algorithm and Programming (Searching)Algorithm and Programming (Searching)
Algorithm and Programming (Searching)
Adam Mukharil Bachtiar
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
sohelranasweet
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Max flow min cut
Max flow min cutMax flow min cut
Max flow min cut
Mayank Garg
 
Best,worst,average case .17581556 045
Best,worst,average case .17581556 045Best,worst,average case .17581556 045
Best,worst,average case .17581556 045
university of Gujrat, pakistan
 
Selection sort
Selection sortSelection sort
Selection sort
amna izzat
 
Big o notation
Big o notationBig o notation
Big o notation
hamza mushtaq
 
Disjoint sets union, find
Disjoint sets  union, findDisjoint sets  union, find
Disjoint sets union, find
subhashchandra197
 
Selection sort
Selection sortSelection sort
Selection sort
smlagustin
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
DigiGurukul
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
CHANDAN KUMAR
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
Rachana Pathak
 
Selection sort algorithm presentation, selection sort example using power point
Selection sort algorithm presentation, selection sort example using power point Selection sort algorithm presentation, selection sort example using power point
Selection sort algorithm presentation, selection sort example using power point
University of Science and Technology Chitttagong
 

Viewers also liked (20)

Algorithm and Programming (Branching Structure)
Algorithm and Programming (Branching Structure)Algorithm and Programming (Branching Structure)
Algorithm and Programming (Branching Structure)
Adam Mukharil Bachtiar
 
Algorithm and Programming (Record)
Algorithm and Programming (Record)Algorithm and Programming (Record)
Algorithm and Programming (Record)
Adam Mukharil Bachtiar
 
Algorithm and Programming (Array)
Algorithm and Programming (Array)Algorithm and Programming (Array)
Algorithm and Programming (Array)
Adam Mukharil Bachtiar
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
Adam Mukharil Bachtiar
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)
Adam Mukharil Bachtiar
 
Jjj sem título 1
Jjj sem título 1Jjj sem título 1
Jjj sem título 1
Juliana De Souza Pereira
 
Ground SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - AfghanistanGround SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - Afghanistan
Angelene Green
 
Mid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - AfghanistanMid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - Afghanistan
Angelene Green
 
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Annapujolo
 
Introdução ao Teste de Software
Introdução ao Teste de SoftwareIntrodução ao Teste de Software
Introdução ao Teste de Software
X25 Treinamento e Consultoria
 
La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016
Annapujolo
 
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Adam Mukharil Bachtiar
 
Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)
Adam Mukharil Bachtiar
 
Pertemuan viii Sorting
Pertemuan viii SortingPertemuan viii Sorting
Pertemuan viii Sorting
Putra Andry
 
certificate in health and safety level 2
certificate in health and safety level 2certificate in health and safety level 2
certificate in health and safety level 2
Luca De Rosa
 
Certificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ PublonsCertificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ Publons
Mohamad Amin Kaviani
 
Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS) Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS)
Uma Chidiebere
 
Bucaramanga en los últimos 25 años
Bucaramanga en los últimos 25 añosBucaramanga en los últimos 25 años
Bucaramanga en los últimos 25 años
josenino2002
 
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Ardhy Danu
 
Algorithm and Programming (Branching Structure)
Algorithm and Programming (Branching Structure)Algorithm and Programming (Branching Structure)
Algorithm and Programming (Branching Structure)
Adam Mukharil Bachtiar
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
Adam Mukharil Bachtiar
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)
Adam Mukharil Bachtiar
 
Ground SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - AfghanistanGround SIGINT Specialist - Afghanistan
Ground SIGINT Specialist - Afghanistan
Angelene Green
 
Mid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - AfghanistanMid Level Counterintelligence Support Specialist - Afghanistan
Mid Level Counterintelligence Support Specialist - Afghanistan
Angelene Green
 
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016Linx Nòrdic 1r ESO La Salle Manlleu 2016
Linx Nòrdic 1r ESO La Salle Manlleu 2016
Annapujolo
 
La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016La pluja àcida - 1r ESO - LS Manlleu 2016
La pluja àcida - 1r ESO - LS Manlleu 2016
Annapujolo
 
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Adam Mukharil Bachtiar
 
Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)
Adam Mukharil Bachtiar
 
Pertemuan viii Sorting
Pertemuan viii SortingPertemuan viii Sorting
Pertemuan viii Sorting
Putra Andry
 
certificate in health and safety level 2
certificate in health and safety level 2certificate in health and safety level 2
certificate in health and safety level 2
Luca De Rosa
 
Certificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ PublonsCertificate for Peer Review Week '16 _ Publons
Certificate for Peer Review Week '16 _ Publons
Mohamad Amin Kaviani
 
Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS) Amyotrophic Lateral Sclerosis (ALS)
Amyotrophic Lateral Sclerosis (ALS)
Uma Chidiebere
 
Bucaramanga en los últimos 25 años
Bucaramanga en los últimos 25 añosBucaramanga en los últimos 25 años
Bucaramanga en los últimos 25 años
josenino2002
 
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Rangkuman Buku Bahasa Indonesia (Univ. Mercu Buana)
Ardhy Danu
 
Ad

Similar to Algorithm and Programming (Sorting) (20)

UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptxUNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
akashkhedar262
 
Chapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for printChapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for print
Abdii Rashid
 
Sorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesSorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - Notes
Omprakash Chauhan
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in Algoritm
Ehsan Ehrari
 
sorting.pptx
sorting.pptxsorting.pptx
sorting.pptx
DrRanjeetKumar51721
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
Muhammad Hammad Waseem
 
sorting algorithm graphical method
sorting algorithm graphical method sorting algorithm graphical method
sorting algorithm graphical method
Shantanu Mishra
 
Sorting
SortingSorting
Sorting
Abhishek Khune
 
Sorting
SortingSorting
Sorting
Govind Upadhyay
 
Unit6 C
Unit6 C Unit6 C
Unit6 C
arnold 7490
 
Unit 7 sorting
Unit   7 sortingUnit   7 sorting
Unit 7 sorting
Dabbal Singh Mahara
 
Searching Sorting-SELECTION ,BUBBBLE.ppt
Searching  Sorting-SELECTION ,BUBBBLE.pptSearching  Sorting-SELECTION ,BUBBBLE.ppt
Searching Sorting-SELECTION ,BUBBBLE.ppt
kunalpatil5661
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to others
Ajay Chimmani
 
Lecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxLecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptx
xalahama3
 
Sorting
SortingSorting
Sorting
Sameer Memon
 
Stack
StackStack
Stack
Tejas Patel
 
Data Structures 6
Data Structures 6Data Structures 6
Data Structures 6
Dr.Umadevi V
 
algorithm unit 1
algorithm unit 1algorithm unit 1
algorithm unit 1
Monika Choudhery
 
Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...
BhumikaBiyani1
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch
 
UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptxUNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
UNIT I- Sesgfnbghnghnghmghmhgmhmhsion 4.pptx
akashkhedar262
 
Chapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for printChapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for print
Abdii Rashid
 
Sorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesSorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - Notes
Omprakash Chauhan
 
Insersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in AlgoritmInsersion & Bubble Sort in Algoritm
Insersion & Bubble Sort in Algoritm
Ehsan Ehrari
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
Muhammad Hammad Waseem
 
sorting algorithm graphical method
sorting algorithm graphical method sorting algorithm graphical method
sorting algorithm graphical method
Shantanu Mishra
 
Searching Sorting-SELECTION ,BUBBBLE.ppt
Searching  Sorting-SELECTION ,BUBBBLE.pptSearching  Sorting-SELECTION ,BUBBBLE.ppt
Searching Sorting-SELECTION ,BUBBBLE.ppt
kunalpatil5661
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to others
Ajay Chimmani
 
Lecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptxLecture-1-Algorithms.pptx
Lecture-1-Algorithms.pptx
xalahama3
 
Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...Sorting in data structures and algorithms , it has all the necessary points t...
Sorting in data structures and algorithms , it has all the necessary points t...
BhumikaBiyani1
 
Design and Analysis of algorithms
Design and Analysis of algorithmsDesign and Analysis of algorithms
Design and Analysis of algorithms
Dr. Rupa Ch
 
Ad

More from Adam Mukharil Bachtiar (20)

Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdf
Adam Mukharil Bachtiar
 
Clean Code - Formatting Code
Clean Code - Formatting CodeClean Code - Formatting Code
Clean Code - Formatting Code
Adam Mukharil Bachtiar
 
Clean Code - Clean Comments
Clean Code - Clean CommentsClean Code - Clean Comments
Clean Code - Clean Comments
Adam Mukharil Bachtiar
 
Clean Method
Clean MethodClean Method
Clean Method
Adam Mukharil Bachtiar
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful Names
Adam Mukharil Bachtiar
 
Model Driven Software Development
Model Driven Software DevelopmentModel Driven Software Development
Model Driven Software Development
Adam Mukharil Bachtiar
 
Scrum: How to Implement
Scrum: How to ImplementScrum: How to Implement
Scrum: How to Implement
Adam Mukharil Bachtiar
 
Pengujian Perangkat Lunak
Pengujian Perangkat LunakPengujian Perangkat Lunak
Pengujian Perangkat Lunak
Adam Mukharil Bachtiar
 
Data Mining Clustering
Data Mining ClusteringData Mining Clustering
Data Mining Clustering
Adam Mukharil Bachtiar
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma Greedy
Adam Mukharil Bachtiar
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute Force
Adam Mukharil Bachtiar
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Adam Mukharil Bachtiar
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi Asimptotik
Adam Mukharil Bachtiar
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi Asimptotik
Adam Mukharil Bachtiar
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
Adam Mukharil Bachtiar
 
UML dan Use Case View
UML dan Use Case ViewUML dan Use Case View
UML dan Use Case View
Adam Mukharil Bachtiar
 
Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdf
Adam Mukharil Bachtiar
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful Names
Adam Mukharil Bachtiar
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma Greedy
Adam Mukharil Bachtiar
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute Force
Adam Mukharil Bachtiar
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Adam Mukharil Bachtiar
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi Asimptotik
Adam Mukharil Bachtiar
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi Asimptotik
Adam Mukharil Bachtiar
 

Recently uploaded (20)

🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqwML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
YumnaShahzaad
 
A Deep Dive into Odoo CRM: Lead Management, Automation & More
A Deep Dive into Odoo CRM: Lead Management, Automation & MoreA Deep Dive into Odoo CRM: Lead Management, Automation & More
A Deep Dive into Odoo CRM: Lead Management, Automation & More
SatishKumar2651
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Download Canva Pro 2025 PC Crack Latest Version .
Download Canva Pro 2025 PC Crack Latest Version .Download Canva Pro 2025 PC Crack Latest Version .
Download Canva Pro 2025 PC Crack Latest Version .
sadiyabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025
Tidyflow
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqwML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
ML-Topic1A.ppteeweqeqeqeqeqeqwewqqwwqeeqeqw
YumnaShahzaad
 
A Deep Dive into Odoo CRM: Lead Management, Automation & More
A Deep Dive into Odoo CRM: Lead Management, Automation & MoreA Deep Dive into Odoo CRM: Lead Management, Automation & More
A Deep Dive into Odoo CRM: Lead Management, Automation & More
SatishKumar2651
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Download Canva Pro 2025 PC Crack Latest Version .
Download Canva Pro 2025 PC Crack Latest Version .Download Canva Pro 2025 PC Crack Latest Version .
Download Canva Pro 2025 PC Crack Latest Version .
sadiyabibi60507
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025Best Accounting Practice Management Software Guide for 2025
Best Accounting Practice Management Software Guide for 2025
Tidyflow
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 

Algorithm and Programming (Sorting)

  • 1. Adam Mukharil Bachtiar English Class Informatics Engineering 2011 Algorithms and Programming Sorting
  • 2. Steps of the Day Let’s Start Definition of Sorting Bubble Sort Selection Sort
  • 4. WhatisSorting Process that arranges random data into sorted data. Data can be sorted into ascending or descending.
  • 6. Bubble Sort Definition and Structures of Bubble Sort
  • 7. WhatisBubbleSort • Sorting algorithm which was inspired by bubble soap. • Comparing element of array (i) with next element of it (i+1). • If i is bigger than i+1 then swap value of each element.
  • 8. Ilustration of Bubble Sort Array: 5 3 7 9 2 3 6 4 3 1 L. 1 3 5 7 2 3 6 4 3 1 9 L. 2 3 5 2 3 6 4 3 1 7 9 L. 3 3 2 3 5 4 3 1 6 7 9 L. 4 2 3 3 4 3 1 5 6 7 9 L. 5 2 3 3 3 1 4 5 6 7 9 L. 6 2 3 3 1 3 4 5 6 7 9 L. 7 2 3 1 3 3 4 5 6 7 9 L. 8 2 1 3 3 3 4 5 6 7 9 L. 9 1 2 3 3 3 4 5 6 7 9
  • 9. Process of Bubble Sort (Ascending) This is an array that will be sorted in Ascending way: 6 3 9 1 5 Step 1 : 6 3 9 1 5 6 3 9 1 5 6 3 1 9 5 6 1 3 9 5 1 6 3 9 5 j j j j
  • 10. Process of Bubble Sort (Ascending) Step 2 : 1 6 3 9 5 1 6 3 5 9 1 6 3 5 9 1 3 6 5 9 j j j
  • 11. Process of Bubble Sort (Ascending) Step 3 : 1 3 6 5 9 1 3 6 5 9 1 3 5 6 9 Step 4 : 1 3 5 6 9 1 3 5 6 9 Array after sorted in ascending ways: 1 3 5 6 9 j j j
  • 12. General Format for Bubble Sort Ascending 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Procedure BubbleSortAsc(I/O nama_var_array : nama_tipe_array, Input N : integer) {I.S. : array[1..N] sudah terdefinisi} {F.S. : menghasilkan array[1..N] yang tersusun secara ascending} Kamus: i, j : integer temp : tipedata Algoritma: for i  1 to N-1 do for j  n downto i+1 do if(nama_var_array[j] < nama_var_array[j-1]) then temp  nama_var_array[j] nama_var_array[j]  nama_var_array[j-1] nama_var_array[j-1]  temp endif endfor endfor EndProcedure
  • 13. Process of Bubble Sort (Descending) This is an array that will be sorted in Descending way : 6 3 9 1 5 Step 1 : 6 3 9 1 5 6 3 9 1 5 6 9 3 1 5 6 9 3 1 5 6 9 3 5 1 j j j j
  • 14. Process of Bubble Sort (Descending) Step 2 : 6 9 3 5 1 9 6 3 5 1 9 6 3 5 1 9 6 5 3 1 j j j
  • 15. Process of Bubble Sort (Descending) Step 3 : 9 6 5 3 1 9 6 5 3 1 9 6 5 3 1 Step 4 : 9 6 5 3 1 9 6 5 3 1 Array after sorted in descending ways: 9 6 5 3 1 j j j
  • 16. General Format for Bubble Sort Descending 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Procedure BubbleSortDesc (I/O nama_var_array : nama_tipe_array, Input N : integer) {I.S. : array[1..N] sudah terdefinisi} {F.S. : menghasilkan array[1..N] yang tersusun secara descending} Kamus: i,j : integer temp : tipedata Algoritma: for i  1 to N-1 do for j  1 to (N - i) do if(nama_var_array[j] < nama_var_array[j+1]) then temp  nama_var_array[j] nama_var_array[j]  nama_var_array[j+1] nama_var_array[j+1]  temp endif endfor endfor EndProcedure
  • 17. Selection Sort Definition and Structures of Selection Sort
  • 18. WhatisSelectionSort Sorting algorithm that arranges random data by selecting the biggest data or the smallest one.
  • 20. Process of Maximum Sort (Ascending) This is an array that will be sorted in Ascending way : 6 3 9 1 5 Step 1 : 6 3 9 1 5 6 3 9 1 5 6 3 9 1 5 6 3 9 1 5 6 3 9 1 5 6 3 5 1 9 j j j jmax max max max max j
  • 21. Process of Maximum Sort (Ascending) Step 2 : 6 3 5 1 9 6 3 5 1 9 6 3 5 1 9 6 3 5 1 9 1 3 5 6 9 j j jmax max max max j
  • 22. Process of Maximum Sort (Ascending) Step 3 : 1 3 5 6 9 1 3 5 6 9 1 3 5 6 9 1 3 5 6 9 Step 4 : 1 3 5 6 9 1 3 5 6 9 Array after sorted in descending way: 1 3 5 6 9 j j max max max max j j max
  • 23. General Format for Maximum Sort Ascending 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Procedure MaximumSortAsc(I/O nama_var_array : nama_tipe_array, Input N : integer) {I.S. : array [1..N] sudah terdefinisi} {F.S. : menghasilkan array [1..N] yang tersusun secara ascending} Kamus: i, j, max, x : integer temp : tipedata Algoritma: x  n for i  1 to N-1 do max  1 for j  2 to x do if(nama_var_array[j] > nama_var_array[max]) then max  j endif endfor temp  nama_var_array[max] nama_var_array[max]  nama_var_array[j] nama_var_array[j]  temp x  x - 1 endfor EndProcedure
  • 24. General Format for Minimum Sort Ascending 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Procedure MinimumSortAsc(I/O nama_var_array : nama_tipe_array, Input N : integer) {I.S. : array[1..n] sudah terdefinisi} {F.S. : menghasilkan array [1..n] yang tersusun secara ascending} Kamus: i, j, min : integer temp : tipedata Algoritma: for i  1 to (N – 1) do min  i for j  i+1 to N do if(nama_var_array[j] < nama_var_array[min]) then min  j endif endfor temp  nama_var_array[min] nama_var_array[min]  nama_var_array[i] nama_var_array[i]  temp endfor EndProcedure
  • 25. Contact Person: Adam Mukharil Bachtiar Informatics Engineering UNIKOM Jalan Dipati Ukur Nomor. 112-114 Bandung 40132 Email: [email protected] Blog: http://adfbipotter.wordpress.com Copyright © Adam Mukharil Bachtiar 2011