SlideShare a Scribd company logo
Adam Mukharil Bachtiar
English Class
Informatics Engineering 2011
Algorithms and Programming
Array
Steps of the Day
Let’s Start
Definition of
Array
One Dimension
Array
Two
Dimensions
Array
Definition of Array
All About Array
BackgroundofArray
I need a program to process students data but i
want it to keep all data temporary in memory
so i can use it until the program is shut down.
WhatisArray
Data structure that saves a group of
variables which have same type.
IlustrationofArray
An Array was named bil, has integer type,
and consists of five elemens.
SUBSCRIPT / INDEX
TypesofArray
• One Dimension Array
• Two Dimensions Array
• Many Dimensions Array (i will not explain THIS!!!)
One Dimension Array
Definition and Structures of One Dimension Array
WhatisOneDimensionArray
Array that only has one subscript / index.
DeclarationofOneDimension
Array
• As variable
• As user-defined data type
• Define size of array as constant
Declaration As Variable (Algorithm)
Kamus:
NamaArray : array [1..MaxSize] of TipeData
Contoh:
Kamus:
bil : array [1..5] of integer
NamaDosen : array [1..20] of string
Pecahan : array [1..100] of real
Declaration As Variable (Pascal)
var
NamaArray : array [1..MaxSize] of TipeData;
Contoh:
var
bil : array [1..5] of integer;
NamaDosen : array [1..20] of string[30];
Pecahan : array [1..100] of real;
Declaration As User-Defined Data Type (Algorithm)
Kamus:
type
NamaArray = array [1..MaxSize] of TipeData
NamaVariabel_1:NamaArray
NamaVariabel_2:NamaArray
Declaration As User-Defined Data Type (Algorithm)
Contoh:
Kamus:
type
bil = array [1..5] of integer
bilbulat:bil
bilpositif:bil
type
NamaArray = array [1..MaxSize] of TipeData;
var
NamaVariabel_1:NamaArray;
NamaVariabel_2:NamaArray;
Declaration As User-Defined Data Type (Pascal)
Contoh:
type
bil = array [1..5] of integer;
var
bilbulat:bil;
bilpositif:bil;
Declaration As User-Defined Data Type (Pascal)
Define Size of Array As Constant (Algorithm)
Kamus:
const
MaxSize = VALUE
type
NamaArray = array [1..MaxSize] of TipeData
NamaVariabel_1:NamaArray
NamaVariabel_2:NamaArray
Contoh:
Kamus:
const
maks = 5
type
bil = array [1..maks] of integer
bilbulat:bil
Define Size of Array As Constant (Algorithm)
const
MaxSize = VALUE;
type
NamaArray : array [1..MaxSize] of TipeData;
var
NamaVariabel:NamaArray;
Define Size of Array As Constant (Pascal)
Contoh:
const
maks = 5;
type
bil = array [1..maks] of integer;
var
bilbulat:bil;
Define Size of Array As Constant (Pascal)
GetandsettheValuefrom
Array
To fill and access the value in array, call the name
of array and its subscript that you want to access
IlustrationofSettingand
GettingValueinArray
bil[1]=5  it means fill 5 in [1]
a=bil[2]  a will be filled by 1
Format of Accessing Array (Algorithm)
namaarray[indeks]  nilai
input(namaarray[indeks])
namaarray[indeks]  namaarray[indeks] + 1
output(namaarray[indeks])
Format of Accessing Array (Algorithm)
namaarray[indeks] := nilai;
readln(namaarray[indeks]);
namaarray[indeks] := namaarray[indeks] + 1;
writeln(namaarray[indeks]);
OperationinArray
• Creation
• Traversal
• Searching
• Sorting
• Destroy
ArrayCreation
• Prepare array to be accessed/processed.
Array will be filled with default value.
• For numeric array will be filled with 0 and
for alphanumeric array will be filled with ‘ ’
(Null Character)
Procedure create (output NamaVarArray:NamaArray)
{I.S: elemen array diberi harga awal agar siap digunakan}
{F.S: menghasilkan array yang siap digunakan}
Kamus:
indeks:integer
Algoritma:
for indeks  1 to maks_array do
nama_var_array[indeks] 0 {sesuaikan dengan tipe array}
endfor
EndProcedure
Array Creation (Algorithm)
procedure create (var NamaVarArray:NamaArray);
var
indeks:integer;
begin
for indeks := 1 to maks do
NamaVarArray[indeks] := 0;
end;
Array Creation (Pascal)
ArrayTraversal
The process of visiting all elements of
array one by one, from the first
element until last element.
TraversalProcesses • Fill elements array with data
• Output all elements of array
• Adding data to array
• Insert data in particular index
• Delete data in particular index
• Determine maximum and minimum data in
array
• Count mean value in array
Procedure traversal (I/O NamaVarArray:NamaArray)
{I.S: maksimum array sudah terdefinisi}
{F.S: menghasilkan array yang sudah diproses}
Kamus:
Algoritma:
for indeks  1 to maks do
{proses traversal}
endfor
Terminasi {sifatnya optional}
EndProcedure
General Form for Array Traversal (Algorithm)
procedure traversal(var NamaVarArray:NamaArray);
begin
for indeks := 1 to maks do
{proses traversal yang dipilih}
terminasi {sifatnya optional}
end;
General Form for Array Traversal (Pascal)
DestroytheArray
The process to return value of array
into default value that was given in
array creation.
Algorithm and Programming (Array)
Example of One Dimension Array (Algorithm)
1
2
3
4
5
6
7
8
9
10
11
12
13
Algoritma ArrayDasar
{I.S.: Dideklarasikan dua buah array satu dimensi}
{F.S.: Menampilkan array beserta hasil perhitungan}
Kamus:
const
maks=5
type
bil=array[1..maks] of integer
bil1,bil2:bil
i:integer
jumlah,jumlah2:integer
Example of One Dimension Array (Algorithm)
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Algoritma:
{input elemen array}
for i  1 to maks do
input(bil1[i])
endfor
for i  1 to maks do
input(bil2[i])
endfor
{output elemen array}
for i  1 to maks do
output(bil1[i])
endfor
Example of One Dimension Array (Algorithm)
28
29
30
31
32
33
34
35
37
38
39
40
for i  1 to maks do
output(bil2[i])
endfor
{proses perhitungan array}
jumlah0;
for i  1 to maks do
jumlahjumlah+bil1[i]
endfor
output(jumlah)
jumlah20;
Example of One Dimension Array (Algorithm)
41
42
43
44
for i  1 to maks do
jumlah2jumlah2+bil2[i]
endfor
output(jumlah2)
Example of One Dimension Array (Pascal)
1
2
3
4
5
6
7
8
9
10
11
12
13
program ArrayDasar;
uses crt;
const
maks=5;
type
bil=array[1..maks] of integer;
var
bil1,bil2:bil;
i:integer;
jumlah,jumlah2:integer;
Example of One Dimension Array (Pascal)
14
15
16
17
18
19
20
21
22
23
24
25
26
27
begin
{input elemen array}
for i:=1 to maks do
begin
write('Masukkan nilai ke bil 1 [',i,'] : ');
readln(bil1[i]);
end;
writeln();
for i:=1 to maks do
begin
write('Masukkan nilai ke bil 2 [',i,'] : ');
readln(bil2[i]);
end;
Example of One Dimension Array (Pascal)
28
29
30
31
32
33
34
35
37
38
39
40
{output elemen array}
for i:=1 to maks do
begin
writeln('Bil 1[',i,'] = ',bil1[i]);
end;
writeln();
for i:=1 to maks do
begin
writeln('Bil 2[',i,'] = ',bil2[i]);
end;
Example of One Dimension Array (Pascal)
41
42
43
44
45
46
47
48
49
50
51
52
53
{proses perhitungan array}
writeln();
jumlah:=0;
for i:=1 to maks do
begin
jumlah:=jumlah+bil1[i];
end;
writeln('Jumlah elemen array bil 1 = ',jumlah);
writeln();
jumlah2:=0;
for i:=1 to maks do
begin
Example of One Dimension Array (Pascal)
54
55
56
57
58
59
60
61
jumlah2:=jumlah2+bil2[i];
end;
writeln('Jumlah elemen array bil 2 = ',jumlah2);
writeln();
write('Tekan sembarang tombol untuk menutup...');
readkey();
end.
Two Dimensions Array
Definition and Structures of Two Dimensions Array
WhatisTwoDimensionsArray
Array that has two subscripts in its
declaration. It often was called matrix.
IlustrationofTwoDimensions
Array
Declaration As Variable (Algorithm)
Kamus:
NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData
Contoh:
Kamus:
matriks : array [1..5,1..5] of integer
Declaration As Variable (Pascal)
var
NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData;
Contoh:
var
matriks: array [1..5,1..5] of integer;
Declaration As User-Defined Data Type (Algorithm)
Kamus:
type
NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData
NamaVariabel_1:NamaArray
NamaVariabel_2:NamaArray
Declaration As User-Defined Data Type (Algorithm)
Contoh:
Kamus:
type
matriks = array [1..5,1..5] of integer
matriks1:matriks
type
NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData;
var
NamaVariabel_1:NamaArray;
NamaVariabel_2:NamaArray;
Declaration As User-Defined Data Type (Pascal)
Contoh:
type
matriks = array [1..5,1..5] of integer;
var
matriks1:bil;
matriks2:bil;
Declaration As User-Defined Data Type (Pascal)
Define Size of Array As Constant (Algorithm)
Kamus:
const
MaxBaris = VALUE1
MaxKolom = VALUE2
type
NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData
NamaVariabel_1:NamaArray
NamaVariabel_2:NamaArray
Contoh:
Kamus:
const
MaksBaris = 5
MaksKolom = 5
type
matriks = array [1..MaksBaris,1..MaksKolom] of integer
matriks1,matriks2:bil
Define Size of Array As Constant (Algorithm)
const
MaxBaris = VALUE1;
MaxKolom = VALUE2;
type
NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData;
var
NamaVariabel:NamaArray;
Define Size of Array As Constant (Pascal)
Contoh:
const
MaksBaris = 5;
MaksKolom = 5;
type
matriks = array [1..MaksBaris,1..MaksKolom] of integer;
var
bilbulat:bil;
Define Size of Array As Constant (Pascal)
OperationinTwoDimensions
Array
Operation in two dimensions array is same
as operation in one dimensions array.
OperationinArray
• Creation
• Traversal
• Searching
• Sorting
• Destroy
ArrayCreation
• Prepare array to be accessed/processed.
Array will be filled with default value.
• For numeric array will be filled with 0 and
for alphanumeric array will be filled with ‘ ’
(Null Character)
Procedure create (output NamaVarArray:NamaArray)
{I.S: elemen array diberi harga awal agar siap digunakan}
{F.S: menghasilkan array yang siap digunakan}
Kamus:
i,j:integer
Algoritma:
for i  1 to MaksBaris do
for j 1 to MaksKolom do
nama_var_array[i,j]  0 {sesuaikan dengan tipe array}
endfor
endfor
EndProcedure
Array Creation (Algorithm)
procedure create (var NamaVarArray:NamaArray);
var
i,j:integer;
begin
for i := 1 to MaksBaris do
begin
for j := 1 to MaksKolom do
NamaVarArray[i,j] := 0;
end;
end;
Array Creation (Pascal)
ArrayTraversal
The process of visiting all elements of
array one by one, from the first
element until last element.
TraversalProcesses • Fill elements array with data
• Output all elements of array
• Adding data to array
• Insert data in particular index
• Delete data in particular index
• Determine maximum and minimum data in
array
• Count mean value in array
Procedure traversal (I/O NamaVarArray:NamaArray)
{I.S: maksimum array sudah terdefinisi}
{F.S: menghasilkan array yang sudah diproses}
Kamus:
Algoritma:
for i  1 to MaksBaris do
for j  1 to MaksKolom do
{proses traversal}
endfor
endfor
Terminasi {sifatnya optional}
EndProcedure
General Form for Array Traversal (Algorithm)
procedure traversal(var NamaVarArray:NamaArray);
begin
for i := 1 to MaksBaris do
begin
for j := 1 to MaksKolom do
{proses traversal yang dipilih}
end;
terminasi {sifatnya optional}
end;
General Form for Array Traversal (Pascal)
DestroytheArray
The process to return value of array
into default value that was given in
array creation.
Algorithm and Programming (Array)
Example of Two Dimensions Array (Algorithm)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Algoritma ArrayDasar
{I.S.: Dideklarasikan dua buah array dua dimensi}
{F.S.: Menampilkan isi array}
Kamus:
const
MaksBaris=5
MaksKolom=5
type
bil=array[1..MaksBaris,1..MaksKolom] of integer
matriks1,matriks2:bil
i,j:integer
Example of Two Dimensions Array (Algorithm)
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Algoritma:
{input elemen array}
for i  1 to MaksBaris do
for j  1 to MaksKolom do
input(bil1[i,j])
endfor
endfor
for i  1 to MaksBaris do
for j  1 to MaksKolom do
input(bil2[i,j])
endfor
endfor
Example of Two Dimensions Array (Algorithm)
29
30
31
32
33
34
35
37
38
39
40
41
{output elemen array}
for i  1 to MaksBaris do
for j  1 to MaksKolom do
output(bil1[i,j])
endfor
endfor
for i  1 to MaksBaris do
for j  1 to MaksKolom do
output(bil1[i,j])
endfor
endfor
Example of Two Dimensions Array (Pascal)
1
2
3
4
5
6
7
8
9
10
11
12
13
program ArrayDuaDimensiDasar;
uses crt;
const
MaksBaris=3;
MaksKolom=3;
type
matriks = array[1..MaksBaris,1..MaksKolom] of
integer;
var
matriks1,matriks2:matriks;
baris,kolom:integer;
Example of Two Dimensions Array (Pascal)
14
15
16
17
18
19
20
21
22
23
24
25
26
27
begin
{input matriks}
writeln('Input Matriks Pertama');
for baris:=1 to MaksBaris do
begin
for kolom:=1 to MaksKolom do
begin
gotoxy(kolom*5+1,baris+3);
readln(matriks1[baris,kolom]);
end;
end;
writeln();
writeln('Input Matriks Kedua');
Example of Two Dimensions Array (Pascal)
28
29
30
31
32
33
34
35
37
38
39
40
for baris:=1 to MaksBaris do
begin
for kolom:=1 to MaksKolom do
begin
gotoxy(kolom*5+1,baris+9);
readln(matriks2[baris,kolom]);
end;
end;
{output matriks}
clrscr();
writeln('Output Matriks Pertama');
Example of Two Dimensions Array (Pascal)
41
42
43
44
45
46
47
48
49
50
51
52
53
for baris:=1 to MaksBaris do
begin
for kolom:=1 to MaksKolom do
begin
gotoxy(kolom*5+1,baris+3);
write(matriks1[baris,kolom]);
end;
end;
writeln();writeln();
writeln('Output Matriks Kedua');
for baris:=1 to MaksBaris do
begin
Example of Two Dimensions Array (Pascal)
54
55
56
57
58
59
60
61
62
63
64
for kolom:=1 to MaksKolom do
begin
gotoxy(kolom*5+1,baris+9);
write(matriks2[baris,kolom]);
end;
end;
writeln();
write('Tekan sembarang tombol untuk menutup...');
readkey();
end.
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

More Related Content

What's hot (20)

Modelos de Banco de dados e SGBDS
Modelos de Banco de dados e SGBDSModelos de Banco de dados e SGBDS
Modelos de Banco de dados e SGBDS
Mahuan Capeletto Abdala
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdf
abrehamcheru14
 
Databases with SQLite3.pdf
Databases with SQLite3.pdfDatabases with SQLite3.pdf
Databases with SQLite3.pdf
Deepika,Assistant Professor,PES College of Engineering ,Mandya
 
Introduction to Compiler
Introduction to CompilerIntroduction to Compiler
Introduction to Compiler
Radhakrishnan Chinnusamy
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
Kumar
 
Sistemas Operacionais - Aula 07 (Thread e Processos)
Sistemas Operacionais - Aula 07 (Thread e Processos)Sistemas Operacionais - Aula 07 (Thread e Processos)
Sistemas Operacionais - Aula 07 (Thread e Processos)
Leinylson Fontinele
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
AqsaHayat3
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
Saikarthik103212
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
irdginfo
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
Motaz Saad
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
Afzal Badshah
 
Introdução a Linguagem de Programação C
Introdução a Linguagem de Programação CIntrodução a Linguagem de Programação C
Introdução a Linguagem de Programação C
Gercélia Ramos
 
Heaps Binomiais
Heaps BinomiaisHeaps Binomiais
Heaps Binomiais
Orlando Junior
 
Segment tree
Segment treeSegment tree
Segment tree
Sindhuja Kumar
 
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Siti Ismail
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
Chhom Karath
 
Aula 13 - Matrizes
Aula 13 - MatrizesAula 13 - Matrizes
Aula 13 - Matrizes
Pacc UAB
 
1.5 binary search tree
1.5 binary search tree1.5 binary search tree
1.5 binary search tree
Krish_ver2
 
Database Chapter 3
Database Chapter 3Database Chapter 3
Database Chapter 3
shahadat hossain
 
Chapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdfChapter 6 Database Security and Authorization (4).pdf
Chapter 6 Database Security and Authorization (4).pdf
abrehamcheru14
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
Kumar
 
Sistemas Operacionais - Aula 07 (Thread e Processos)
Sistemas Operacionais - Aula 07 (Thread e Processos)Sistemas Operacionais - Aula 07 (Thread e Processos)
Sistemas Operacionais - Aula 07 (Thread e Processos)
Leinylson Fontinele
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
AqsaHayat3
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
irdginfo
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
Motaz Saad
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
Afzal Badshah
 
Introdução a Linguagem de Programação C
Introdução a Linguagem de Programação CIntrodução a Linguagem de Programação C
Introdução a Linguagem de Programação C
Gercélia Ramos
 
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil1. Fundamental Concept - Data Structures using C++ by Varsha Patil
1. Fundamental Concept - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Siti Ismail
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
Chhom Karath
 
Aula 13 - Matrizes
Aula 13 - MatrizesAula 13 - Matrizes
Aula 13 - Matrizes
Pacc UAB
 
1.5 binary search tree
1.5 binary search tree1.5 binary search tree
1.5 binary search tree
Krish_ver2
 

Viewers also liked (20)

Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)
Adam Mukharil Bachtiar
 
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 (Sorting)
Algorithm and Programming (Sorting)Algorithm and Programming (Sorting)
Algorithm and Programming (Sorting)
Adam Mukharil Bachtiar
 
Algorithm and Programming (Searching)
Algorithm and Programming (Searching)Algorithm and Programming (Searching)
Algorithm and Programming (Searching)
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
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
indra Kishor
 
Gui
GuiGui
Gui
Eyelean xilef
 
Pascal
PascalPascal
Pascal
Ezeodum Austin
 
Chap 7(array)
Chap 7(array)Chap 7(array)
Chap 7(array)
Bangabandhu Sheikh Mujibur Rahman Science and Technology University
 
Ppt lesson 12
Ppt lesson 12Ppt lesson 12
Ppt lesson 12
Linda Bodrie
 
Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)
Adam Mukharil Bachtiar
 
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
 
Contoh Kasus untuk ER dan Relasional Model
Contoh Kasus untuk ER dan Relasional ModelContoh Kasus untuk ER dan Relasional Model
Contoh Kasus untuk ER dan Relasional Model
Adam Mukharil Bachtiar
 
Scrum for CodeLabs
Scrum for CodeLabsScrum for CodeLabs
Scrum for CodeLabs
Adam Mukharil Bachtiar
 
2- Dimensional Arrays
2- Dimensional Arrays2- Dimensional Arrays
2- Dimensional Arrays
Education Front
 
Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)
Adam Mukharil Bachtiar
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
Hock Leng PUAH
 
Data Management (Introducing of Datawarehouse)
Data Management (Introducing of Datawarehouse)Data Management (Introducing of Datawarehouse)
Data Management (Introducing of Datawarehouse)
Adam Mukharil Bachtiar
 
Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)
Adam Mukharil Bachtiar
 
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
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
indra Kishor
 
Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)
Adam Mukharil Bachtiar
 
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
 
Contoh Kasus untuk ER dan Relasional Model
Contoh Kasus untuk ER dan Relasional ModelContoh Kasus untuk ER dan Relasional Model
Contoh Kasus untuk ER dan Relasional Model
Adam Mukharil Bachtiar
 
Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)
Adam Mukharil Bachtiar
 
Data Management (Introducing of Datawarehouse)
Data Management (Introducing of Datawarehouse)Data Management (Introducing of Datawarehouse)
Data Management (Introducing of Datawarehouse)
Adam Mukharil Bachtiar
 
Ad

Similar to Algorithm and Programming (Array) (20)

Arrays c4 c5
Arrays c4 c5Arrays c4 c5
Arrays c4 c5
Omar Al-Sabek
 
Lecture 2a arrays
Lecture 2a arraysLecture 2a arrays
Lecture 2a arrays
Victor Palmar
 
Data Structures - Array presentation .pptx
Data Structures - Array presentation .pptxData Structures - Array presentation .pptx
Data Structures - Array presentation .pptx
IshanKapoor26
 
ADVANCED DATA STRUCTURES AND ALGORITHMS.pptx
ADVANCED DATA STRUCTURES AND ALGORITHMS.pptxADVANCED DATA STRUCTURES AND ALGORITHMS.pptx
ADVANCED DATA STRUCTURES AND ALGORITHMS.pptx
brajmohan21nitj
 
arrays in data structure.pptx
arrays in data structure.pptxarrays in data structure.pptx
arrays in data structure.pptx
KasthuriKAssistantPr
 
Array
ArrayArray
Array
PRN USM
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
Koteswari Kasireddy
 
arrayy.ppt
arrayy.pptarrayy.ppt
arrayy.ppt
ssuserb82af5
 
Programming Logic and Design: Arrays
Programming Logic and Design: ArraysProgramming Logic and Design: Arrays
Programming Logic and Design: Arrays
Nicole Ryan
 
Array in c
Array in cArray in c
Array in c
Harsh Bhanushali
 
2.DS Array
2.DS Array2.DS Array
2.DS Array
Chandan Singh
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
HarmanShergill5
 
Arrays
ArraysArrays
Arrays
DebiPrasadSen
 
UNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptxUNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptx
sangeeta borde
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
poonam.rwalia
 
Lesson 11 one dimensional array
Lesson 11 one dimensional arrayLesson 11 one dimensional array
Lesson 11 one dimensional array
MLG College of Learning, Inc
 
One Dimensional Array
One Dimensional Array One Dimensional Array
One Dimensional Array
dincyjain
 
Ppt on arrays in c
Ppt on arrays in cPpt on arrays in c
Ppt on arrays in c
Abhinay Pratap
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithms
Aakash deep Singhal
 
Chapter12
Chapter12Chapter12
Chapter12
ARAC Company
 
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)

Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right WayMigrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Best Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small BusinessesBest Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small Businesses
TheTelephony
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Best Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small BusinessesBest Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small Businesses
TheTelephony
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Leveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer IntentsLeveraging Foundation Models to Infer Intents
Leveraging Foundation Models to Infer Intents
Keheliya Gallaba
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 

Algorithm and Programming (Array)

  • 1. Adam Mukharil Bachtiar English Class Informatics Engineering 2011 Algorithms and Programming Array
  • 2. Steps of the Day Let’s Start Definition of Array One Dimension Array Two Dimensions Array
  • 4. BackgroundofArray I need a program to process students data but i want it to keep all data temporary in memory so i can use it until the program is shut down.
  • 5. WhatisArray Data structure that saves a group of variables which have same type.
  • 6. IlustrationofArray An Array was named bil, has integer type, and consists of five elemens. SUBSCRIPT / INDEX
  • 7. TypesofArray • One Dimension Array • Two Dimensions Array • Many Dimensions Array (i will not explain THIS!!!)
  • 8. One Dimension Array Definition and Structures of One Dimension Array
  • 9. WhatisOneDimensionArray Array that only has one subscript / index.
  • 10. DeclarationofOneDimension Array • As variable • As user-defined data type • Define size of array as constant
  • 11. Declaration As Variable (Algorithm) Kamus: NamaArray : array [1..MaxSize] of TipeData Contoh: Kamus: bil : array [1..5] of integer NamaDosen : array [1..20] of string Pecahan : array [1..100] of real
  • 12. Declaration As Variable (Pascal) var NamaArray : array [1..MaxSize] of TipeData; Contoh: var bil : array [1..5] of integer; NamaDosen : array [1..20] of string[30]; Pecahan : array [1..100] of real;
  • 13. Declaration As User-Defined Data Type (Algorithm) Kamus: type NamaArray = array [1..MaxSize] of TipeData NamaVariabel_1:NamaArray NamaVariabel_2:NamaArray
  • 14. Declaration As User-Defined Data Type (Algorithm) Contoh: Kamus: type bil = array [1..5] of integer bilbulat:bil bilpositif:bil
  • 15. type NamaArray = array [1..MaxSize] of TipeData; var NamaVariabel_1:NamaArray; NamaVariabel_2:NamaArray; Declaration As User-Defined Data Type (Pascal)
  • 16. Contoh: type bil = array [1..5] of integer; var bilbulat:bil; bilpositif:bil; Declaration As User-Defined Data Type (Pascal)
  • 17. Define Size of Array As Constant (Algorithm) Kamus: const MaxSize = VALUE type NamaArray = array [1..MaxSize] of TipeData NamaVariabel_1:NamaArray NamaVariabel_2:NamaArray
  • 18. Contoh: Kamus: const maks = 5 type bil = array [1..maks] of integer bilbulat:bil Define Size of Array As Constant (Algorithm)
  • 19. const MaxSize = VALUE; type NamaArray : array [1..MaxSize] of TipeData; var NamaVariabel:NamaArray; Define Size of Array As Constant (Pascal)
  • 20. Contoh: const maks = 5; type bil = array [1..maks] of integer; var bilbulat:bil; Define Size of Array As Constant (Pascal)
  • 21. GetandsettheValuefrom Array To fill and access the value in array, call the name of array and its subscript that you want to access
  • 22. IlustrationofSettingand GettingValueinArray bil[1]=5  it means fill 5 in [1] a=bil[2]  a will be filled by 1
  • 23. Format of Accessing Array (Algorithm) namaarray[indeks]  nilai input(namaarray[indeks]) namaarray[indeks]  namaarray[indeks] + 1 output(namaarray[indeks])
  • 24. Format of Accessing Array (Algorithm) namaarray[indeks] := nilai; readln(namaarray[indeks]); namaarray[indeks] := namaarray[indeks] + 1; writeln(namaarray[indeks]);
  • 25. OperationinArray • Creation • Traversal • Searching • Sorting • Destroy
  • 26. ArrayCreation • Prepare array to be accessed/processed. Array will be filled with default value. • For numeric array will be filled with 0 and for alphanumeric array will be filled with ‘ ’ (Null Character)
  • 27. Procedure create (output NamaVarArray:NamaArray) {I.S: elemen array diberi harga awal agar siap digunakan} {F.S: menghasilkan array yang siap digunakan} Kamus: indeks:integer Algoritma: for indeks  1 to maks_array do nama_var_array[indeks] 0 {sesuaikan dengan tipe array} endfor EndProcedure Array Creation (Algorithm)
  • 28. procedure create (var NamaVarArray:NamaArray); var indeks:integer; begin for indeks := 1 to maks do NamaVarArray[indeks] := 0; end; Array Creation (Pascal)
  • 29. ArrayTraversal The process of visiting all elements of array one by one, from the first element until last element.
  • 30. TraversalProcesses • Fill elements array with data • Output all elements of array • Adding data to array • Insert data in particular index • Delete data in particular index • Determine maximum and minimum data in array • Count mean value in array
  • 31. Procedure traversal (I/O NamaVarArray:NamaArray) {I.S: maksimum array sudah terdefinisi} {F.S: menghasilkan array yang sudah diproses} Kamus: Algoritma: for indeks  1 to maks do {proses traversal} endfor Terminasi {sifatnya optional} EndProcedure General Form for Array Traversal (Algorithm)
  • 32. procedure traversal(var NamaVarArray:NamaArray); begin for indeks := 1 to maks do {proses traversal yang dipilih} terminasi {sifatnya optional} end; General Form for Array Traversal (Pascal)
  • 33. DestroytheArray The process to return value of array into default value that was given in array creation.
  • 35. Example of One Dimension Array (Algorithm) 1 2 3 4 5 6 7 8 9 10 11 12 13 Algoritma ArrayDasar {I.S.: Dideklarasikan dua buah array satu dimensi} {F.S.: Menampilkan array beserta hasil perhitungan} Kamus: const maks=5 type bil=array[1..maks] of integer bil1,bil2:bil i:integer jumlah,jumlah2:integer
  • 36. Example of One Dimension Array (Algorithm) 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Algoritma: {input elemen array} for i  1 to maks do input(bil1[i]) endfor for i  1 to maks do input(bil2[i]) endfor {output elemen array} for i  1 to maks do output(bil1[i]) endfor
  • 37. Example of One Dimension Array (Algorithm) 28 29 30 31 32 33 34 35 37 38 39 40 for i  1 to maks do output(bil2[i]) endfor {proses perhitungan array} jumlah0; for i  1 to maks do jumlahjumlah+bil1[i] endfor output(jumlah) jumlah20;
  • 38. Example of One Dimension Array (Algorithm) 41 42 43 44 for i  1 to maks do jumlah2jumlah2+bil2[i] endfor output(jumlah2)
  • 39. Example of One Dimension Array (Pascal) 1 2 3 4 5 6 7 8 9 10 11 12 13 program ArrayDasar; uses crt; const maks=5; type bil=array[1..maks] of integer; var bil1,bil2:bil; i:integer; jumlah,jumlah2:integer;
  • 40. Example of One Dimension Array (Pascal) 14 15 16 17 18 19 20 21 22 23 24 25 26 27 begin {input elemen array} for i:=1 to maks do begin write('Masukkan nilai ke bil 1 [',i,'] : '); readln(bil1[i]); end; writeln(); for i:=1 to maks do begin write('Masukkan nilai ke bil 2 [',i,'] : '); readln(bil2[i]); end;
  • 41. Example of One Dimension Array (Pascal) 28 29 30 31 32 33 34 35 37 38 39 40 {output elemen array} for i:=1 to maks do begin writeln('Bil 1[',i,'] = ',bil1[i]); end; writeln(); for i:=1 to maks do begin writeln('Bil 2[',i,'] = ',bil2[i]); end;
  • 42. Example of One Dimension Array (Pascal) 41 42 43 44 45 46 47 48 49 50 51 52 53 {proses perhitungan array} writeln(); jumlah:=0; for i:=1 to maks do begin jumlah:=jumlah+bil1[i]; end; writeln('Jumlah elemen array bil 1 = ',jumlah); writeln(); jumlah2:=0; for i:=1 to maks do begin
  • 43. Example of One Dimension Array (Pascal) 54 55 56 57 58 59 60 61 jumlah2:=jumlah2+bil2[i]; end; writeln('Jumlah elemen array bil 2 = ',jumlah2); writeln(); write('Tekan sembarang tombol untuk menutup...'); readkey(); end.
  • 44. Two Dimensions Array Definition and Structures of Two Dimensions Array
  • 45. WhatisTwoDimensionsArray Array that has two subscripts in its declaration. It often was called matrix.
  • 47. Declaration As Variable (Algorithm) Kamus: NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData Contoh: Kamus: matriks : array [1..5,1..5] of integer
  • 48. Declaration As Variable (Pascal) var NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData; Contoh: var matriks: array [1..5,1..5] of integer;
  • 49. Declaration As User-Defined Data Type (Algorithm) Kamus: type NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData NamaVariabel_1:NamaArray NamaVariabel_2:NamaArray
  • 50. Declaration As User-Defined Data Type (Algorithm) Contoh: Kamus: type matriks = array [1..5,1..5] of integer matriks1:matriks
  • 51. type NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData; var NamaVariabel_1:NamaArray; NamaVariabel_2:NamaArray; Declaration As User-Defined Data Type (Pascal)
  • 52. Contoh: type matriks = array [1..5,1..5] of integer; var matriks1:bil; matriks2:bil; Declaration As User-Defined Data Type (Pascal)
  • 53. Define Size of Array As Constant (Algorithm) Kamus: const MaxBaris = VALUE1 MaxKolom = VALUE2 type NamaArray = array [1..MaxBaris,1..MaxKolom] of TipeData NamaVariabel_1:NamaArray NamaVariabel_2:NamaArray
  • 54. Contoh: Kamus: const MaksBaris = 5 MaksKolom = 5 type matriks = array [1..MaksBaris,1..MaksKolom] of integer matriks1,matriks2:bil Define Size of Array As Constant (Algorithm)
  • 55. const MaxBaris = VALUE1; MaxKolom = VALUE2; type NamaArray : array [1..MaxBaris,1..MaxKolom] of TipeData; var NamaVariabel:NamaArray; Define Size of Array As Constant (Pascal)
  • 56. Contoh: const MaksBaris = 5; MaksKolom = 5; type matriks = array [1..MaksBaris,1..MaksKolom] of integer; var bilbulat:bil; Define Size of Array As Constant (Pascal)
  • 57. OperationinTwoDimensions Array Operation in two dimensions array is same as operation in one dimensions array.
  • 58. OperationinArray • Creation • Traversal • Searching • Sorting • Destroy
  • 59. ArrayCreation • Prepare array to be accessed/processed. Array will be filled with default value. • For numeric array will be filled with 0 and for alphanumeric array will be filled with ‘ ’ (Null Character)
  • 60. Procedure create (output NamaVarArray:NamaArray) {I.S: elemen array diberi harga awal agar siap digunakan} {F.S: menghasilkan array yang siap digunakan} Kamus: i,j:integer Algoritma: for i  1 to MaksBaris do for j 1 to MaksKolom do nama_var_array[i,j]  0 {sesuaikan dengan tipe array} endfor endfor EndProcedure Array Creation (Algorithm)
  • 61. procedure create (var NamaVarArray:NamaArray); var i,j:integer; begin for i := 1 to MaksBaris do begin for j := 1 to MaksKolom do NamaVarArray[i,j] := 0; end; end; Array Creation (Pascal)
  • 62. ArrayTraversal The process of visiting all elements of array one by one, from the first element until last element.
  • 63. TraversalProcesses • Fill elements array with data • Output all elements of array • Adding data to array • Insert data in particular index • Delete data in particular index • Determine maximum and minimum data in array • Count mean value in array
  • 64. Procedure traversal (I/O NamaVarArray:NamaArray) {I.S: maksimum array sudah terdefinisi} {F.S: menghasilkan array yang sudah diproses} Kamus: Algoritma: for i  1 to MaksBaris do for j  1 to MaksKolom do {proses traversal} endfor endfor Terminasi {sifatnya optional} EndProcedure General Form for Array Traversal (Algorithm)
  • 65. procedure traversal(var NamaVarArray:NamaArray); begin for i := 1 to MaksBaris do begin for j := 1 to MaksKolom do {proses traversal yang dipilih} end; terminasi {sifatnya optional} end; General Form for Array Traversal (Pascal)
  • 66. DestroytheArray The process to return value of array into default value that was given in array creation.
  • 68. Example of Two Dimensions Array (Algorithm) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Algoritma ArrayDasar {I.S.: Dideklarasikan dua buah array dua dimensi} {F.S.: Menampilkan isi array} Kamus: const MaksBaris=5 MaksKolom=5 type bil=array[1..MaksBaris,1..MaksKolom] of integer matriks1,matriks2:bil i,j:integer
  • 69. Example of Two Dimensions Array (Algorithm) 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Algoritma: {input elemen array} for i  1 to MaksBaris do for j  1 to MaksKolom do input(bil1[i,j]) endfor endfor for i  1 to MaksBaris do for j  1 to MaksKolom do input(bil2[i,j]) endfor endfor
  • 70. Example of Two Dimensions Array (Algorithm) 29 30 31 32 33 34 35 37 38 39 40 41 {output elemen array} for i  1 to MaksBaris do for j  1 to MaksKolom do output(bil1[i,j]) endfor endfor for i  1 to MaksBaris do for j  1 to MaksKolom do output(bil1[i,j]) endfor endfor
  • 71. Example of Two Dimensions Array (Pascal) 1 2 3 4 5 6 7 8 9 10 11 12 13 program ArrayDuaDimensiDasar; uses crt; const MaksBaris=3; MaksKolom=3; type matriks = array[1..MaksBaris,1..MaksKolom] of integer; var matriks1,matriks2:matriks; baris,kolom:integer;
  • 72. Example of Two Dimensions Array (Pascal) 14 15 16 17 18 19 20 21 22 23 24 25 26 27 begin {input matriks} writeln('Input Matriks Pertama'); for baris:=1 to MaksBaris do begin for kolom:=1 to MaksKolom do begin gotoxy(kolom*5+1,baris+3); readln(matriks1[baris,kolom]); end; end; writeln(); writeln('Input Matriks Kedua');
  • 73. Example of Two Dimensions Array (Pascal) 28 29 30 31 32 33 34 35 37 38 39 40 for baris:=1 to MaksBaris do begin for kolom:=1 to MaksKolom do begin gotoxy(kolom*5+1,baris+9); readln(matriks2[baris,kolom]); end; end; {output matriks} clrscr(); writeln('Output Matriks Pertama');
  • 74. Example of Two Dimensions Array (Pascal) 41 42 43 44 45 46 47 48 49 50 51 52 53 for baris:=1 to MaksBaris do begin for kolom:=1 to MaksKolom do begin gotoxy(kolom*5+1,baris+3); write(matriks1[baris,kolom]); end; end; writeln();writeln(); writeln('Output Matriks Kedua'); for baris:=1 to MaksBaris do begin
  • 75. Example of Two Dimensions Array (Pascal) 54 55 56 57 58 59 60 61 62 63 64 for kolom:=1 to MaksKolom do begin gotoxy(kolom*5+1,baris+9); write(matriks2[baris,kolom]); end; end; writeln(); write('Tekan sembarang tombol untuk menutup...'); readkey(); end.
  • 76. 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