Skip to content

Instantly share code, notes, and snippets.

/* selection sort implementation in C */
#include<stdio.h>
/* swapping two elements by reference */
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
/* insertion sort implementation in C */
#include<stdio.h>
/* swapping two elements by reference */
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
#include<stdio.h>
/*copy two arrays*/
void copyArray(int readFrom[], int begin, int end, int writeTo[])
{
int i=0,j=begin;
while(i<end-begin+1)
{
writeTo[i] = readFrom[j];
i++;
/* Implementaion of quicksort in C*/
#include<stdio.h>
/*swap two elements*/
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
/* selection problem solution in C*/
#include<stdio.h>
/*swap two elements*/
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;