Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
8 views
3 pages
2
CodeTantra Solution Programme 2
Uploaded by
devraikunal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save 2 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
8 views
3 pages
2
CodeTantra Solution Programme 2
Uploaded by
devraikunal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save 2 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save 2 For Later
You are on page 1
/ 3
Search
Fullscreen
SNo:2 EXP. Name: Write aC program to Sort the elements using Insertion Sort . Technique im: Date:2023-10-03 Write a program to sort the given elements using Insertion sort technique ( Ascending order ), Source Code: (racine | Hincludecstdio.h> void main() { int a[20], 4, n, J, temps printé("n ="); scanf("Rd", &n)3 // Wieite the for loop to read array elements for(i = @s4cnsit+)( print#("a[")5 printf("%d",4); printf( scanf("%d",8a[1])5 i) printf("Before sorting : \n"); // Wirite the for loop to display array elenents before sorting For(1 = @s4cnsit+){ printf("a[")5 print#("%d", 4); printf("] ="); print®("%d\n",a4])5 > //kirite the code to sort elenents for(i = Lsicnsit+){ temp = ali]; j=is while(j>=088a[4j]>temp){ a(j+1] = ali]s ged + a[J+1] = temp; > printf("After sorting : \n"); // veite the for loop to display array elenents after sorting For(i=0;Lensi++){ print#( print ("%a" printé( printé("%d\n",a[1]); Execution Results - 1 test cases have succeeded! Page No: 1 ib: 2200331540075 2022-2026-CSE-0S-8 stitute Of Technology Raj Kumar GoelTest Case - 1 (User Output h= 5 [el = 22, bay = 4 [2] = 27 B) = 37, lta) = 42 before sorting + [e] = 32 af2] = 4 lz] = 27 [31 = 37, al4] = 42 hafter sorting + [el] = 4 (2) = 12 (2) = 27 [3] = 37 [4] = at Test Case -2 (User Output h=7 (eo) = 3 alt] = 8 af2] = 2 l= 2 [4] = 4 fats] = 9 [6] = 4 before sorting + bio] = 3 [a] - 8 a[2] = 2 a[3] = 4 bia] = 4 5] = 9 af6)] = 4 (feer sorting [e] = 3 (2) = 2 2) = 3 Bl. 4 bia] = 4 b{s] = 8 [6] = 9 Test Case -3 (User Output h= 5 Page No: 2 ib: 2200331540075 2022-2026-CSE-0S-8 te Of Technology Raj Kumar Goo! Inst(e] = -36 bia] = -¢0 (2p = 43 aL3] = 54 bra] =o Before sorting = a[@] = -36 ja[1] = -100 y= 43 13] = 54 [4] = 6 ter sorting # [2] = -100 bpay = 43 (2) = 36 a[3] = © bra) = 54 Page No: 3 0: 2200331540075 2022-2026-CSE-0S-8 te Of Technology Raj Kumar Goo! Inst
You might also like
Insertion SORT AND LINEAR SEARCH
PDF
No ratings yet
Insertion SORT AND LINEAR SEARCH
5 pages
Design and Analysis of Algorithm (Lab)
PDF
No ratings yet
Design and Analysis of Algorithm (Lab)
27 pages
Lab Record Download 2
PDF
No ratings yet
Lab Record Download 2
203 pages
DS Unit-1
PDF
No ratings yet
DS Unit-1
14 pages
1
PDF
No ratings yet
1
3 pages
Data Structure Practical File
PDF
No ratings yet
Data Structure Practical File
59 pages
Design and Anal Lab Record 2023 12 20
PDF
No ratings yet
Design and Anal Lab Record 2023 12 20
58 pages
Functions.: S.No: 19 Date: 2022-03-14
PDF
No ratings yet
Functions.: S.No: 19 Date: 2022-03-14
3 pages
GH PDP
PDF
No ratings yet
GH PDP
24 pages
Week 1 & Week 2
PDF
No ratings yet
Week 1 & Week 2
40 pages
Ram CTSD New
PDF
No ratings yet
Ram CTSD New
72 pages
Atik Ada Assignment - Removed Att111
PDF
No ratings yet
Atik Ada Assignment - Removed Att111
35 pages
Ada Lab File
PDF
No ratings yet
Ada Lab File
38 pages
Vivek
PDF
No ratings yet
Vivek
13 pages
Jitendra Daa
PDF
No ratings yet
Jitendra Daa
12 pages
Jitendra Kumar Daa
PDF
No ratings yet
Jitendra Kumar Daa
12 pages
Ds Exp 2.2 AMAN
PDF
No ratings yet
Ds Exp 2.2 AMAN
5 pages
Daa Experiments
PDF
No ratings yet
Daa Experiments
14 pages
Exp1 Aa-B2.44
PDF
No ratings yet
Exp1 Aa-B2.44
8 pages
Workbook
PDF
No ratings yet
Workbook
22 pages
IU2141230328 DAA Prac No 2
PDF
No ratings yet
IU2141230328 DAA Prac No 2
8 pages
Level 2 Answers
PDF
No ratings yet
Level 2 Answers
10 pages
5
PDF
No ratings yet
5
3 pages
Name: Sanket Rahangdale REG No.: 19010855 ROLL No: B-171: Practical-2
PDF
No ratings yet
Name: Sanket Rahangdale REG No.: 19010855 ROLL No: B-171: Practical-2
11 pages
Code Tantra Dsa Aktu
PDF
No ratings yet
Code Tantra Dsa Aktu
60 pages
AOA - LAB Manual - 2024-25 - Anuja
PDF
No ratings yet
AOA - LAB Manual - 2024-25 - Anuja
67 pages
ASSIGNMENT
PDF
No ratings yet
ASSIGNMENT
22 pages
Debmalya Biswas ECE
PDF
No ratings yet
Debmalya Biswas ECE
11 pages
NAME: Biswa Bhusan Gupta ROLL NO: 1805030: Soln 4.1
PDF
No ratings yet
NAME: Biswa Bhusan Gupta ROLL NO: 1805030: Soln 4.1
9 pages
Lab Record Download
PDF
No ratings yet
Lab Record Download
58 pages
Data Structure: Name:Naveen Kumar
PDF
No ratings yet
Data Structure: Name:Naveen Kumar
8 pages
Code of Basic C Programs With Output
PDF
No ratings yet
Code of Basic C Programs With Output
22 pages
Exp ALL
PDF
No ratings yet
Exp ALL
35 pages
Exp 1 AOA SE2 40
PDF
No ratings yet
Exp 1 AOA SE2 40
8 pages
Dsa Da1 FINAL
PDF
No ratings yet
Dsa Da1 FINAL
23 pages
Data Structure Assignment
PDF
No ratings yet
Data Structure Assignment
12 pages
Arun Exp-5
PDF
No ratings yet
Arun Exp-5
3 pages
Lab Manual
PDF
No ratings yet
Lab Manual
86 pages
How To Stored Value in The Memorey With Figures and Examples 1D and 2D Array
PDF
No ratings yet
How To Stored Value in The Memorey With Figures and Examples 1D and 2D Array
22 pages
DAA Lab Project
PDF
No ratings yet
DAA Lab Project
27 pages
8612lab Manual EXPT No. 1 AOA - Selection Sort
PDF
No ratings yet
8612lab Manual EXPT No. 1 AOA - Selection Sort
12 pages
DIPLOMA DAA Lab Program Lab Record 2024 12 07
PDF
No ratings yet
DIPLOMA DAA Lab Program Lab Record 2024 12 07
25 pages
Ds File - PDF - 20250114 - 191620 - 0000
PDF
No ratings yet
Ds File - PDF - 20250114 - 191620 - 0000
19 pages
Data Structures Lab Record Format
PDF
No ratings yet
Data Structures Lab Record Format
37 pages
L1 L3
PDF
No ratings yet
L1 L3
54 pages
AratrikaLab Record Download
PDF
No ratings yet
AratrikaLab Record Download
49 pages
DAA Lab File Ashutosh
PDF
No ratings yet
DAA Lab File Ashutosh
30 pages
Vidya Bhavan College For Engineering Technology, Rautapur, Chaubeypur, Kanpur
PDF
No ratings yet
Vidya Bhavan College For Engineering Technology, Rautapur, Chaubeypur, Kanpur
22 pages
ADA Hiren
PDF
No ratings yet
ADA Hiren
42 pages
AIM: Program To Find Factorial of A Number by Using Recursion
PDF
No ratings yet
AIM: Program To Find Factorial of A Number by Using Recursion
18 pages
Design Analysis of Algorithm1
PDF
No ratings yet
Design Analysis of Algorithm1
17 pages
Test-1 Answer Key
PDF
No ratings yet
Test-1 Answer Key
23 pages
Lab 8
PDF
No ratings yet
Lab 8
8 pages
Final Data Structure Lab (Bcs351)
PDF
No ratings yet
Final Data Structure Lab (Bcs351)
38 pages
Data Lab File 1 (AutoRecovered)
PDF
No ratings yet
Data Lab File 1 (AutoRecovered)
44 pages
ADA - Lab Manual - 5th CE - IT Final
PDF
No ratings yet
ADA - Lab Manual - 5th CE - IT Final
40 pages
Sree Narayana College: Kollam
PDF
No ratings yet
Sree Narayana College: Kollam
62 pages
Design and Analysis of Algorithms
PDF
No ratings yet
Design and Analysis of Algorithms
23 pages
DS Notes Unit 1
PDF
No ratings yet
DS Notes Unit 1
32 pages
Unit 1
PDF
No ratings yet
Unit 1
20 pages
DS Notes Unit 2
PDF
No ratings yet
DS Notes Unit 2
19 pages
2
PDF
No ratings yet
2
2 pages
1
PDF
No ratings yet
1
2 pages