Professional Documents
Culture Documents
(ISAS)
Faculty:
Written By:
Depok 16424
PREFACE
Praise the presence of Allah SWT for his permission, so that the author can complete the
isas with the title ”Implementation and Analysis of aCounting Sort". Appreciation and thanks to
the writer give to Mr. Muhammad Riza Iqbal Latief, S.T. as a faculty of class 2 NAP 1 and other
teaching staff who always help. Thank you also to fellow students who have supported and also
thank you for being a colleague in education at CCIT-FTUI.
The task of this isas the author made with the aim to complete the assessment of learning
in CCIT-FTUI. With this paper the author hopes to provide benefits to readers and listeners so as
to increase knowledge and insight.
Finally, the writer realizes that this thesis is far from perfect. Therefore, the authors
request suggestions and criticisms that are constructive for perfection and hopefully useful for us
all. Amin.
Author
ii
TABLE OF CONTENTS
PREFACE ................................................................................................................................ ii
TABLE OF CONTENTS ........................................................................................................ iii
TABLE OF FIGURE .............................................................................................................. iv
CHAPTER I INTRODUCTION............................................................................................ 1
1.1 Background ............................................................................................................... 1
.2 Writing Objective ...................................................................................................... 1
.3 Problem Domain ...................................................................................................... 1
.4 Writing Methodology ................................................................................................ 1
.5 Writing Framework ................................................................................................... 2
CHAPTER II BASIC THEORY ............................................................................................ 3
.1 Definition of Algorithm ............................................................................................ 3
.2 History of Algorithm ................................................................................................. 3
.3 Type of Algorithm .................................................................................................... 4
.4 Definition of Sorting Algorithm ............................................................................... 5
.5 Type of Sorting Algorithm ........................................................................................ 5
.6 Definition of Counting Sort....................................................................................... 6
.7 Characteristic of Counting Sort ................................................................................ 7
.8 Counting Sort for Sorting Data of Number Drop Out School .................................. 7
.9 Definition and Factors of Drop Out School .............................................................. 7
CHAPTER III PROBLEM ANALYSIS ............................................................................... 8
.1 Implementing of Counting Sort ................................................................................ 8
.2 How to Counting Sort Work...................................................................................... 8
.3 Efficiency of Counting Sort....................................................................................... 9
.4 Counting Sort for Sorting Number of Drop Out School .......................................... 10
CHAPTER IV CONCLUSION AND SUGGESTION ....................................................... 12
.1 Conclusion ................................................................................................................ 12
.2 Suggestion ................................................................................................................. 12
BIBILOGRAPHY ................................................................................................................... 13
iii
TABLE OF FIGURE
iv
CHAPTER I
INTRODUCTION
.1 Background
Algorithm is a collection of commands that have a very large use for the community.
The algorithm is usually used as a collection of commands to solve a problem. In
mathematics and computer science, the meaning of an algorithm is a step-by-step procedure
for calculation. Algorithms are used for calculation, automatic reasoning, and data
processing. One of the most important sorting algorithms in information technology is
Counting Sort.
Counting sort is a sorting technique by counting the number of occurrences of each
data in the array. In this algorithm we have to create a container array to store the number of
occurrences of data where the size of the array must be a range of numbers that can be input
by the user. This algorithm can sort data from large to small (Ascending) and small to large
(Descending). This algorithm is not suitable for large data sets.
In the process, the counting sort algorithm technique involves counting or calculating
data numbers and array indexes. The calculation includes addition and subtraction.
Therefore, this sorting algorithm technique is called Counting Sort. This algorithm was
created by Harold H. Seward in 1954.
Therefore in this ISAS, we want to analyze the implementation of Counting Sort. So
that readers can better understand about Counting Sort.
.2 Writing Objective
The purpose of writing a paper entitled "Implementation and Analysis of Counting
Sort" is to analyze and explain the Implementation of Counting Sort so as to increase reader
knowledge.
.3 Problem Domain
In this paper, we will discuss the Function and Implementation of Counting Sort.
.4 Writing Methodology
The method we use to write this paper is to collect data from online articles, from
online books, and research.
v
.5 Writing Framework
Chapter I (Introduction) :
In Chapter we will discuss the background of the problem, Writing Objective, the
purpose of the problem, Problem Domain, the Writing Methodology and the Writing
Framework.
Chapter II (Basic Theory) :
In Chapter II, will discuss about definition, history, type of algorithm.
Chapter III (Problem Analysis) :
Discussion of the chosen topic, more detailed explanation, and profound. As well as
solutions to the problems discussed in Chapter 1.
Chapter IV (Conclusion and Suggestion) :
Contains conclusions from the author about the experience gained after explaining in
Chapter 3.
vi
CHAPTER II
BASIC THEORY
Al-Khuwarizmi was born in Khwarizm (kheva), a city located south of the Oxus
River (now Uzbekistan). When he was little, he moved with his parents south of the city
of Baghdad (Iraq). One of Al-Khuwarizmi's famous books is Kitab Al Jabar Wal-
Muqabala which means "The book of restoration and reduction." From the title of the
book, too, we get the word "Algebra" which is now a branch of mathematics. Another
source of writing algorithms is a special method that is appropriate and consists of a series
vii
of steps that are structured and mathematically written, which will be done to solve a
problem with the help of a computer. Like a strong building has a good frame structure.
Likewise, a good program or application must also be composed by a good programming
structure. The technique of structuring the program is called an algorithm [ CITATION Kan17
\l 1033 ].
.3 Type of Algorithm
There are various kinds of algorithms that are often used in the programming world, some
examples of algorithm are:
1. Hashing Algorithms
Hashing is a string of characters into a value that represents the original string.
According to the language, hash means to chop off and then combine.
2. Link Analysis Algorithms
The link analysis algorithm is based on two assumptions, namely a link submitted by
someone and a page quoted by a particular page and may have the same topic. In
general, in the calculation of link analysis, the web is considered as the smallest unit
in web graph development. Thus, every link on each web will be considered the
same, regardless of the location of the link.
3. Search Algorithms
Searching is a very important process in data processing. The search process is
finding certain values or data in a set of data of the same type. Search algorithm
(search algorithm) is an algorithm that accepts a keyword (key), then there are
certain steps to look for records with that keyword.
4. Dynamic Programming Algorithms
Dynamic Programming is one of the algorithm design techniques that was developed
to solve very complex problems by breaking down these problems into many sub-
problems.
5. Sort Algorithms
Sort algorithm (Sort Algorithms) is a collection of steps systematically or
sequentially to obtain the desired results. One example of the algorithm for this step
is sorting. Sorting can be defined as sorting a number of data based on certain
values.
viii
That are some example of algorithm type. And in this isas the author will depending
about sorting algorithms.
ix
3. Selection Sort
Selection Sort is a combination of sorting and searching. This method is very
simple because every process will look for the elements that have not been sorted
the smallest (ascending) or largest (descending) which will be exchanged to the
right position in the array.
4. Marge Sort
In this algorithm the data set is divided into sub-groups which are then sorted
separately, and then rejoined by the merging method. In reality this algorithm
performs the sorting method of merge sort also to sort the subset of data, or in other
words, the sorting is done recursively.
5. Quick Sort
Quick sort is a highly efficient sorting algorithm and is based on partitioning of
array of data into smaller arrays. A large array is partitioned into two arrays one of
which holds values smaller than the specified value, say pivot, based on which the
partition is made and another array holds values greater than the pivot value.
Quicksort partitions an array and then calls itself recursively twice to sort the two
resulting subarrays. This algorithm is quite efficient for large-sized data sets as its
average and worst-case complexity are O(n Log n) and image.png(n2), respectively.
B. Non-Comparison Sort
1. Counting sort
Counting Sort is a sorting technique by counting the number of occurrences of each
data in the array. In this algorithm we have to create a container array to store the
number of occurrences of data where the size of the array must be a range of
numbers that can be input by the user.
2. Radix sort
Radix Sort is a sorting technique that sorts the elements by first grouping the
individual digits of same place value. Then, sort the elements according to their
increasing/decreasing order.
.6 Definition of Counting Sort
x
Counting sort is a sorting technique by counting the number of occurrences of each
data in the array. In this algorithm we have to create a container array to store the number
of occurrences of data where the size of the array must be a range of numbers that can be
input by the user. This algorithm can sort data from large to small (ascending) and small to
large (descending). This algorithm is not suitable for large data sets.
In the process, the counting sort algorithm technique involves counting or
calculating data numbers and array indexes. The calculation includes addition and
subtraction. Therefore, this sorting algorithm technique is called Counting Sort. This
algorithm was created by Harold H. Seward in 1954.
.7 Characteristic of Counting Sort
1. Efficient to do the sorting because it does not compare with other data;
2. The condition for this sorting to be carried out is knowing the range of values of the
data;
3. The data to be sorted must also be an integer (integer);
4. Using arrays;
.8 Counting Sort for Sorting Data of Number Drop Out School
In this paper, we will use Counting Sort to sort numbers from data on the number of
students dropping out of school in Indonesia. We chose the number of high school dropout
students to sample the discussion.
.9 Definition and Factors of Drop Out School
According to Gunawan [ CITATION Ano203 \l 1033 ] . Dropping out of school is a
predicate given to former students who are unable to complete an education level, so they
cannot continue their studies to the next level of education. For example, a community
member or child who only attends elementary school until fifth grade, is called primary
school dropout.
There are many factors that cause children to drop out of school. There are factors
that originate from within (internal) students themselves, such as laziness and self
incapacity. There are also factors that come from outside (external) students, such as lack
of funds and educational facilities.
xi
CHAPTER III
PROBLEM ANALYSIS
xii
4. Store cumulative sum of the elements of the count array. It helps in placing the
elements into the correct index. If there are x elements less than y, its position should
be at x-1. For example: In the array below, the count of 4 is 6. It denotes that there are 5
elements smaller than 4. Thus, the position of 4 in the sorted array is 5th.
6. After placing each element at its correct position, decrease the its count by one.
Counting Sort is quite effective for finding data because counting sort does not
compare one data with another data so it does not take much time to count data.
xiii
.4 Counting Sort for Sorting Number of Drop Out School
In this section we will practice the sort calculation method to sort the data on high school
dropout rates in 2018-2019 in Indonesia, we use the Java programming language.
xiv
The Result of Pseudocode :
We will now look at the Java Program for Counting sort functions. The first step is to
collect data on the number of dropouts in Indonesia. After that, we input the data in the form of
numbers into the int [] testArray = {....}. Then we execute and will automatically be sorted from
the smallest to the largest. From this data, we know that the smallest dropout rate is in North
Kalimantan and the largest dropout rate is in West Java.
xv
CHAPTER IV
.1 CONCLUSION
.2 SUGGESTION
From the results of this discussion, we suggest that to sort a data you can use the
Counting Sort Algorithm because it takes a short time, but judging from the amount of
data, if the amount of data is large it requires a lot of arrays as well.
xvi
BIBLIOGRAPHY
xvii