Daa Report
Daa Report
UNIVERSITY
“JNANA SANGAMA”, BELAGAVI- 590018,
KARNATAKA, INDIA
“COUNTING BY SORTING”
Submitted in partial fulfilment of the
requirements for the award of degree of
BACHELOR OF ENGINEERING IN
COMPUTER SCIENCE AND
ENGINEERING
(DATA SCIENCE)
Submitted By
Harshil M(1AT22CD018)
Hoysala K R (1AT22CD020)
CERTIFICATE
Certified that the project work entitled “COUNTING BY SORTING ”
carried out by Harshil M (1AT22CD018), Hoysala K R (1AT22CD020), are
Bonafide students of Department of Computer Science and Engineering (Data
Science), ATRIA I.T., Bengaluru, in partial fulfilment for the award of
Degree of Bachelor of Engineering in Computer Science & Engineering
(Data science) of Visvesvaraya Technological University, Belagavi, during
the academic year 2023-24. It is certified that all corrections/suggestions
indicated for Internal Assessment have been incorporated in the report
deposited in the department library. The mini project report has been approved
as it satisfies the academic requirements in respect of project work prescribed
for the said degree.
External Viva
Signature with date
1. Name of Examiner
2.Name of Examiner
DECLARATION
We Harshil M(1AT22CD018),Hoysala KR(1AT22CD020) student of 4th
semester Bachelor of Engineering, Department of Information Science and
Engineering, Atria Institute of Technology, Bengaluru, would hereby declare that
the Design And Analysis Of Algorithms animation presentation entitled
“COUNTING BY SORTING” has been carried out by us at Atria Institute of
Technology, Bengaluru, and submitted in partial fulfilment of the course
requirement for the award of degree of Bachelor of Engineering in Information
Science and Engineering of Visvesvaraya Technological University, Belagavi,
during the academic year 2023-24.
We further declare that, to the best of our knowledge and belief, the work
embodied in this report has not been submitted to any other university or
institution for the award of any other degree.
Signature of the
student
Hoysala K R
(1AT22CD020)
I
ABSTRACT
II
ACKNOWLEDGEMENT
We thank Dr. Deepak NR, HOD, CSE(DS) for providing us all the
necessary facilities for the successful completion of our Presentation.
Deadlines play a very important role in the successful completion of the
academic project on time, efficiently and effectively.
We take this opportunity to express our deep sense of gratitude to our guide
and coordinators Dr.Jyoti Metan , Associate Professor, Department of
ISE for their valuable guidance and help throughout the course of the
academic. They have always been patient with us and helped immensely in
completing the task on hand. We also thank them for their immense support,
guidance, specifications & ideas without which seminar would have been
completed without full merit.
Last but not least from the Department of Information Science and
Engineering, teaching and non-teaching staffs for their constant
encouragement, support, patience, and endurance shown during the
preparation of this report were remarkable. We also thank the management.
Finally, we thank our parents and friends for their motivation, morale
and material support.
III
CHAPTER TITLE PAGE
NO
DECLARATION I
ABSTRACT II
ACKNOWLEDGEMENT III
1 INTRODUCTION 1
2. COMPARISON COUNTING 2
4 DISTRIBUITION COUNTING 4
7 CONCLUSION 7
TABLE OF CONTENTS
LIST OF FIGURES
INTRODUCTION
COMPARISON COUNTING
Definition:
Comparison counting involves tracking and summing the number of comparisons made
between elements during the sorting process. Comparison Counting involves tallying the
number of comparisons performed between elements during the execution of a sorting
algorithm. It is a crucial metric for analyzing and understanding the efficiency of
comparison-based sorting algorithms. In essence, it quantifies the number of times pairs of
elements are compared to determine their relative order.
Purpose :
It helps in evaluating and comparing the efficiency of different sorting algorithms based on the
number of comparisons they perform is to evaluate the efficiency of comparison-based sorting
algorithms by quantifying the number of element comparisons they perform. This metric helps in
analyzing the algorithm's performance, understanding its time complexity, and comparing different
sorting algorithms based on their operational efficiency.
Example
Time Complexity:
TOh(et+imke) complexity of the counting sort algorithm is O(n+k), where n is the size of the
input array and k is the range of the input values. This makes it a highly efficient algorithm,
especially when the range of input values is small compared to the size of the input array.
Space Complexity:
The space complexity of the counting sort algorithm is also O(n+k), as it requires an
additional array to store the count and cumulative frequency of the input elements.
Stable Sorting :
Counting sort is a stable sorting algorithm, which means that it preserves the relative order of
elements with equal values. This property can be important in certain applications where the
original order of the elements needs to be maintained.
DISTRIBUITION COUNTING
Definition :
Counting sort is a non-comparative integer sorting algorithm that operates by counting the
occurrences of each unique value in the input array. It then uses these counts to determine the
position of each element in the sorted output array. This method is efficient when the range
of input values is limited compared to the number of elements, making it suitable for sorting
large datasets with a small range of values.
Purpose :
Distribution counting sort aims to efficiently sort integers or categorical data by
leveraging the frequency of each value. It works by counting the occurrences of each
value in the input and then using these counts to determine the final position of each
element in the sorted output. This method is particularly useful when the range of
possible values is small compared to the number of elements, ensuring fast sorting
performance.
Example :
FIGURE 4.1
CONCLUSION
In conclusion, counting and sorting are fundamental processes that underpin much of data
management and analysis in computer science. Counting provides the necessary groundwork
for understanding the frequency and distribution of data elements. By tallying occurrences, it
enables more informed decisions about how to process and analyze data. This initial step is
particularly critical in algorithms like Counting Sort, where the frequency of each element
dictates the arrangement of the sorted output. The ability to accurately count and track
occurrences ensures that the subsequent sorting process is both efficient and effective,
allowing for reliable data organization.
Ultimately, the interplay between counting and sorting enhances data management by
providing a structured approach to handling large volumes of information. Counting lays the
foundation by quantifying the data elements, while sorting organizes them in a way that
optimizes access and processing. Together, these operations support a wide range of
applications, from simple data analysis to complex algorithmic solutions. Their integration
ensures that data is not only accurately represented but also efficiently manipulated,
facilitating more effective decision-making and problem-solving across various domains.
Thus, mastering both counting and sorting is essential for anyone involved in data-intensive
fields, ensuring that data handling is both precise and efficient.