Write a program that implements Selection Sort Method to sort a given list of integers in ascending order.
#include<stdio.h>
#include<conio.h>
void selectionsort(int a[],int n);
int main()
{
int a[20],i,n;
printf("enter how many values you want");
scanf("%d",&n);
printf("enter %d elements",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
selectionsort(a,n);
printf("after sorting\n");
for(i=0;i<n;i++)
{
printf("%d\n",a[i]);
}
getch();
return 1;
}
void selectionsort(int a[],int n)
{
int min,i,j,t;
for(i=0;i<n;i++)
{
min=i;
for(j=i+1;j<n;j++)
{
if(a[j]<a[min])
{
min=j;
}
}
t=a[i];
a[i]=a[min];
a[min]=t;
}
}
1) Write a C program that uses functions to perform the following on Singly Linked List: i) Creation ii) Insertion iii) Deletion iv) TraversalView Solution
2) Write a program that uses functions to perform the following operations on Doubly Linked List.: i) Creation ii) Insertion iii) Deletion iv) TraversalView Solution
3) Write a program that uses functions to perform the following operations on Circular Linked List.: i) Creation ii) Insertion iii) Deletion iv) TraversalView Solution
4) Write a program that implement Stack (its operations) using ArraysView Solution
5) Write a program that implement Stack (its operations) using PointersView Solution
6) Write a program that implement Queue (its operations) using ArraysView Solution
7) Write a program that implement Queue (its operations) using PointersView Solution
8) Write a program that implements Bubble Sort Method to sort a given list of integers in ascending order.View Solution
9) Write a program that implements Selection Sort Method to sort a given list of integers in ascending order.View Solution
10) Write a program that implements Insertion Sort Method to sort a given list of integers in ascending order.View Solution
11) Write a program that use both recursive and non recursive functions to perform Linear search operations for a Key value in a given list of integers.View Solution
12) Write a program that use both recursive and non recursive functions to perform Binary search operations for a Key value in a given list of integers.View Solution
13) Write a program to implement the tree traversal methods.View Solution
14) Write a program to implement Depth First Search (DFS) graph traversal methods.View Solution
15) Write a program to implement Breadth First Search (BFS) graph traversal methods.View Solution