Dsu Project
Dsu Project
ACHARYA
POLYTECHNIC, SHELU
RREPORT ON
SORTING
SUBJECT
DATA STRUCTURES USING 'C'
SUBJECT CODE
22317
PROJECT GUIDE
DIKSHIKA BHUNDERE
ACADEMIC YEAR:2023-24
1
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
Place: SHELU
Date:
ENROLLMENT NO.:2211440058
2
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
Place: SHELU
Date:
ENROLLMENT NO.:2211440045
3
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
Place: SHELU
Date:
ENROLLMENT NO.:2211440059
4
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
Place: SHELU
Date:
ENROLLMENT NO.:2211440032
GROUP MEMBERS
ROLL NO. STUDENT NAME ENROLLMENT BRANCH
5
NO.
13 HARSHADA 2211440045 CO
HINWAR
25 SAKSHI 2211440059 CO
NAYAKAWDI
02 PRANAYA LAD 2211440032 CO
24 NAKSHATRA 2211440058 CO
PAWAR
ACKNOWLEDGEMENT
6
We really thankful to our principal……………and the HOD MADHURA
MAHINDRIKAR, Computer Department, G. V. Acharya Polytechnic. Shelu for his
invaluable guidance and assistance, without which the accomplishment of the task
would have never been possible.
We are also thankful to our Guide Mrs. Dikshika Bhundere for this opportunity to
explore into the real world and realize the interrelation without which a project
can never progress.
We are also thankful to parents, friend and all staff of Computer Department, for
providing us relevant information and necessary classifications, and great support.
INDEX
SR NO. TOPIC NAME PAGE NO.
1 ACTION PLAN 9
2 RESOURCE REQUIRED 10
7
3 INTRODUCTION 11
6 PROGRAMS 19-22
7 CONCLUSION 23
8 REFERENCES 24
ACTION PLAN
Sr. Details of Activity Plan Starting Plan Name of
No Finish Responsible
Date
Date Member
1. Searching the topic 20th Nov 20th Nov PRANAYA
for Micro - project LAD
8
from the Data NAYAKAWDI
Structure Using C
22317 reference
books
4. Arrange all 25th Nov 27th Nov NAKSHATRA
information in MS PAWAR
word
5. Prepare a report on it 29th Nov 2nd Dec NAKSHATRA
Using MS word PAWAR
6. Print micro project 9th Dec 9th Dec SAKSHI
NAYAKAWDI
RESOURCE REQUIRED
Sr. Name of resources Material Specifications Quantity
No
1. Computer System Windows 7, 2 1
GB RAM
2. Internet Wifi 1
3. Textbook Data Structure 1
Using C
Language
9
INTRODUCTION
10
TYPES OF SORTING
1. Selection sort.
Selection Sort is a simple comparison-based sorting algorithm. It
repeatedly selects the minimum (or maximum) element from the
unsorted portion and swaps it with the first elements.
Example
Input: [64,25,12,11]
Find the minimum element(11) and swap it with the first element:
[11, 25, 12, 22, 64].
Repeat the process until the entire array is sorted.
2. Bubble Sort.
Bubble Sort is a simple comparison-based sorting algorithm. It
repeatedly steps through the lists, compares adjacent elements,
and swaps them if they are in the wrong order.
Example
11
3. Insertion Sort.
Insertion sort is a simple comparison-based sorting algorithm that
builds the final sorted array one item at a time.
It takes an element from the unsorted part and inserts it into it’s
correct position in the sorted part.
Example
4. Radix Sort.
Radix sort is a non-comparative integer sorting algorithm.
It sorts by processing individual digits or radix position of the
numbers.
Example
12
5. Quick Sort.
Quick sort is a divide-and-conquer sorting algorithm.
It selects a ‘pivot’ element and partitions the array into two sub-
arrays: elements less than the pivot and elements greater than the
pivot.
Recursively sort the sub-arrays.
Example
13
DIFFERENT TYPES OF ALGORITHM
14
Step 1: Insert (A, pos, value)
Step 2: i=pos-1
Step 3: while (i>0 and A[i]> value) do
Step 4: A[i+1]=A[i]
Step 5: i= i-1
Step 6: A[i+1]= value
Step 7: End
15
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
SORTING PROGRAM
16
• Graphs can be represented through matrix (array) in computer
system's memory. This is sequential in nature. This type of
representation is called sequential representation of graphs.
ASSUMPTIONS
G Graph
17
V Set of Vertices
i,j Vertices
• If G is Directed Graph:
A[i][j]={1 if (i,j) exists
0 otherwise
• If G is Undirected Graph:
A[i][j]={1 if (i,j) or (j,i) exists
0 otherwise
PROGRAMS
18
#include<stdio.h> #define
MAX 10
if(adj[x][i] ==1)
outcount++; if(adj[i][x]
==1) incount++;
int main()
scanf(“%d”,&n);
19
for(i=0;i<n;i++) for(j=0;j<n;j+
+)
scanf(“%d”,&adj[i][j]);
for(i=0;i<n;i++)
degree(adj,I,n);
return 0;
Output:
20
Program for direct graph.
#include <stdio.h>
#include <stdlib.h>
21
// Define the maximum number of vertices in the graph
#define N 6
Graph
};
Node
int dest;
};
Edge {
22
int src, dest;
};
graph->head[i] = NULL;
23
int src = edges[i].src;
>next = graph->head[src];
>head[src] = newNode;
return graph;
24
{
(ptr != NULL)
ptr = ptr->next;
printf("\n");
main(void)
// input array containing edges of the graph (as per the above
diagram)
25
// (x, y) pair in the array represents an edge from x to y
{0, 1}, {1, 2}, {2, 0}, {2, 1}, {3, 2}, {4, 5}, {5, 4}
};
int n = sizeof(edges)/sizeof(edges[0]);
printGraph(graph);
return 0;
Output:
26
(0 —> 1)
(1 —> 2)
(2 —> 1) (2 —> 0)
(3 —> 2)
(4 —> 5)
(5 —> 4)
CONCLUSION
27
28
REFERENCES
• www.google.com
• www.javapoint.com
• www.geeksforgeekom
29