You are on page 1of 17

DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Micro project

On
“ RADIX SORT ”
Submitted By

Dhruvil Rupareliya (57)


Rushikesh Chikorde (62)
OMKAR DEVKATTE (70)

Guided By

Ms. S.K. Kawale

Diploma Course in Computer Technology

(As per directives of I Scheme, MSBTE)

Sinhgad Institutes

Sinhgad Technical Education Society’s

SOU. VENUTAI CHAVAN POLYTECHNIC

PUNE - 411041

ACADEMIC YEAR 2023-2024

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Maharashtra State Board of


Technical Education
Certificate
This is to certify that Ms. Dhruvil Rupareliya with Roll No. 57 of Semester III
of Diploma in Computer Technology of Institute Sou. Venutai Chavan
Polytechnic (Code: 0040) has successfully completed the Micro-Project in
Data Structure using ‘C’ (22317) for the academic year 2023-2024 as
prescribed in the curriculum.

Program Code: CM

Course Code: CM/3/I

Place: Pune Enrolment No:

Date: Exam Seat No

Ms.S.K.Kawale Mrs A.V.Kurkute Dr.(Mrs.)M.S.Jadhav


Course Teacher Head of Department Principal

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Maharashtra State Board of


Technical Education
Certificate
This is to certify that Mr. Rushikesh Chikorde with Roll No. 62 of Semester III
of Diploma in Computer Technology of Institute Sou. Venutai Chavan
Polytechnic (Code: 0040) has successfully completed the Micro-Project in
Data Structure using ‘C’ (22317) for the academic year 2023-2024 as
prescribed in the curriculum.

Program Code: CM

Course Code: CM/3/I

Place: Pune Enrolment No:

Date: Exam Seat No:

Ms.S.K.Kawale Mrs A.V.Kurkute Dr.(Mrs.)M.S.Jadhav


Course Teacher Head of Department Principal

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Maharashtra State Board of


Technical Education
Certificate
This is to certify that Mr. omkar devkatte with Roll No. 70 of Semester III
Diploma in Computer Technology of Institute Sou. Venutai Chavan
Polytechnic (Code: 0040) has successfully completed the Micro-Project in
Data Structure using ‘C’ (22317) for the academic year 2023-2024 as
prescribed in the curriculum.

Program Code: CM

Course Code: CM/3/I

Place: Pune Enrolment No:

Date: Exam Seat No:


Ms.S.K.Kawale Mrs A.V.Kurkute Dr.(Mrs.)M.S.Jadhav
Course Teacher Head of Department Principal

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

INDEX

SR NO CONTENTS PAGE NO

1 Aim of the Micro-Project 1

2 Rationale 3

3 Course Outcomes Achieved 3

4 Literature Review 3

5 Actual Methodology Followed 6

6 Actual Resources Used 6

7 Skills Developed 10

8 Applications of Micro Project 10

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Annexure – I

Micro-Project Proposal

1.0 Aim of the Micro-Project:


The aim of the Micro-project is to create a program of radix sort.

2.0 Intended Course Outcomes:

a) Implement basic operations on stack and queue using array representation.

3.0 Proposed methodology:

I. Study concepts of stack and queue.


II. Study the basic syntaxes of C language.
III. Study methods and use of recursion.
IV. Study concept and rules of radix sort .
V. Make the program and debug its error.
VI. Prepare the final report.

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

4.0 Action Plan:

Name of
Sr. Planned Planned
Details of Activity responsible Team
No. Start Date Finish Date
members
Identify and collect requirements of
1 /2023 /2023 Rushikesh chikorde
the project.
Rushikesh
2 Design structure of the project. /2023 /2023
chikorde
and
omkar devkatte
Implement structure of code
3 /2023 /2023 Dhruvil Rupareliya
according to real puzzle.
Code the project in a desired
4 /2023 /2023 Dhruvil Rupareliya
software.
Rushikesh
5 Debug and eliminate errors. /2023 /2023
chikorde
and
omkar devkatte

6 Prepare the final report. / 2023 /2023 Dhruvil Rupareliya

5.0 Resources Required:

S. No. Resources required Specifications


1 Computer system Intel® Pentium CPU, RAM 4 GB

2 Operating System Windows 10, 64 Bit Operating System


3 Software’s Code::Blocks IDE

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

6.0 Team members:

S. No. Roll. number Name of Student


1 57 Dhruvil Rupareliya

2 62 Rushikesh chikorde
3 70 Omkar devkatte

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

Annexure - II
Micro-Project Report

1.0 Rationale:

2.0 A sorting algorithm is an algorithm that puts components of a listing in a certain order.
The most-used orders are numerical order and lexicographic order.

3.0 The Radix sort is a non-comparative sorting algorithm. The Radix sort
algorithm is the most preferred algorithm for the unsorted list.
4.0 It sorts the elements by initially grouping the individual digits of the same place value.
The idea of Radix Sort is to do digit by digit sort starting from least significant
digit(LSD) to the most significant digit(MSD), according to their increasing/decreasing
order. Radix sort is a small method that is used several times when alphabetizing an
oversized list of names. Specifically, the list of names is initially sorted according to the
first letter of every name, thatis, the names are organized in twenty-six categories.

5.0 Aim of the Micro-Project:


The aim of the Micro-project is to create a program of Tower of Hanoi, one of the
ancient games of history.

7.0 Course Outcomes Achieved:


a) Implement basic operations on stack and queue using array representation.

8.0 Literature Review:

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

In the above example, the primary column is input. The remaining columns show the list after
successive sorts on increasingly significant digits position.

Complexity Analysis of Radix Sort O(m.n).

However, if we glance at these 2 values, the size of the keys is comparatively small in comparison to
the number of keys. as an example, if we've six-digit keys, we might have 1,000,000 totally
different records.

Here, we tend to see that the size of the keys isn't important, and this algorithm is of linear quality
O(n)

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

a) Decision making functions in C language:


Conditional statements are used to perform different actions based on different
conditions. In C language we have the following conditional statements:

• Use ‘if’ to specify a block of code to be executed, if a specified condition is true


• Use ‘switch’ to specify many alternative blocks of code to be executed.

a) The ‘if’ statement:


Use the ‘if’ statement to specify a block of code to be executed if the condition is true.

Syntax:

if (condition) {

// Block of code to be executed if the condition is true

b) The ‘switch’ statement:

Use ‘switch’ statement which allows a value to change control of execution.


Syntax:

switch(expression) {
case 1:
// Block of code to be executed if expression = 1
break;

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

case 2:
// Block of code to be executed if expression = 2
break;
….
case n:
// Block of code to be executed if expression = n
break;
default:
// Block of code to be executed if expression does not match any cases
}

b) Recursive function in C language.


The process in which the function calls itself directly or indirectly is called recursionand
corresponding function is called as recursive function
E.g.
// Direct recursion

void function1() {
// Block of code
function1();
// Block of code
}

// Indirect recursion
void function1() {
// Block of code
function2();
// Block of code
}
void function2() {
// Block of code
function1();
// Block of code
}

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

9.0 Actual Methodology Followed:

I. Study concepts of stack and queue.


II. Study the basic syntaxes of C language.
III. Study methods and use of recursion.
IV. Study concept and rules of radix sort.
V. Make the program and debug its error.
VI. Prepare the final report.

10.0 Actual Resources Used:

S. No. Resources required Specifications

1 Computer system Intel®, Pentium CPU, RAM 4 GB

2 Operating System Windows 10, 64-Bit Operating System

3 Software’s Code::Blocks IDE

7.0 Source code of program:


#include <stdio.h>
#include <conio.h>

// Function to find the maximum number in the array


int getMax(int arr[], int n) {
int max = arr[0];
for (int i = 1; i < n; i++) {
if (arr[i] > max) {
max = arr[i];
}
}
return max;
}

// Function to perform counting sort based on the digit represented by exp


void countingSort(int arr[], int n, int exp) {
int output[n];
int count[10] = {0};

// Count occurrences of digits at the current digit place


for (int i = 0; i < n; i++) {
count[(arr[i] / exp) % 10]++;
}
Department of computer technology
DATA STRUCTURE USING ‘C’-22317 RADIX SORT

// Update count[i] to store the position of this digit in output[]


for (int i = 1; i < 10; i++) {
count[i] += count[i - 1];
}

// Build the output array


for (int i = n - 1; i >= 0; i--) {
output[count[(arr[i] / exp) % 10] - 1] = arr[i];
count[(arr[i] / exp) % 10]--;
}

// Copy the output array to arr[], so that arr[] now contains sorted numbers according to
current digit
for (int i = 0; i < n; i++) {
arr[i] = output[i];
}
}

// Radix Sort function


void radixSort(int arr[], int n) {
int max = getMax(arr, n);

// Do counting sort for every digit place


for (int exp = 1; max / exp > 0; exp *= 10) {
countingSort(arr, n, exp);
}
}

// Main function
int main() {
int n;
printf("Enter the number of elements: ");
scanf("%d", &n);
int arr[n];

printf("Enter the elements:\n");


for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}

// Perform Radix Sort


radixSort(arr, n);

// Print the sorted array


printf("Sorted array: ");
for (int i = 0; i < n; i++) {
printf("%d ", arr[i]);
}

getch();
return 0;
}

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

8.0 Output:

Department of computer technology


DATA STRUCTURE USING ‘C’-22317 RADIX SORT

9.0 Skills Developed:


During the course of this micro-project, we learnt to create and execute program of
Radix sort
a) We learnt problem solving technics using recursion.
b) We learnt basic fundamentals of stacks and queue.
c) We also learnt to solve real-world problems using C language.

10.0 Conclusion:
We developed program for solving radix sort

Department of computer technology

You might also like