#include <cstdio> // printf, puts #include <cstdlib> // srand, rand #include <ctime> // time, clock, time_t #include <cstring> // memset // every programmer should know memset ;) #define MAX 6000000 // array size #define RANGE 1000000 // range
Continue reading ...
Daily Archives: October 30, 2013
Implement counting sort in c
#include <cstdio> // printf, puts #include <cstdlib> // srand, rand #include <ctime> // time, clock, time_t #define MAX 10000000 // array size #define RANGE 1000 // range Continue reading ...
implementation of Bucket sort, quicker sort and insertion sort in one c program
#include <cstdio> #include <cstdlib> #include <ctime> const int MAX_LIST_LENGTH = 70000; const int BUCKETS_COUNT = 1000; Continue reading ...
Implement bucket sort in c++
/* Bucket sort implementation using array in ascending order in c++ programming language */
#include <iostream> #include <queue> using namespace std; const int INPUT_SIZE = 20; const int BUCKET_K = 10;
Continue reading ...
Implement Merge sort in c
/* Merge sort implementation using array in ascending order in c programming language */
#include<stdio.h> #define MAX 50 void mergeSort(int arr[],int low,int mid,int high); void partition(int arr[],int low,int high); int main(){
Continue reading ...
Implement bubble sort in c
/* Bubble sort implementation using array ascending order in c programming language */
#include<stdio.h> int main(){ int s,temp,i,j,a[20]; printf("Enter total numbers of elements: "); scanf("%d",&s);
Continue reading ...
Implement insertion sort in c
/* Insertion sort implementation using array in ascending order in c programming language */
#include<stdio.h> int main(){ int i,j,s,temp,a[20]; printf("Enter total elements: "); scanf("%d",&s);
Continue reading ...
Implement quick sort in c
/* Quick sort implementation using array ascending order in c programming language */
#include<stdio.h> void quicksort(int [10],int,int); int main(){ int x[20],size,i; printf("Enter size of the array: "); scanf("%d",&size);
Continue reading ...
Implement Selection sort in c
/* Implement selection sort using array ascending order in c */
#include<stdio.h> int main(){ int s,i,j,temp,a[20]; printf("Enter total elements: "); scanf("%d",&s);
Continue reading ...
Find the largest number in c
/* Find the largest number in C */
#include<stdio.h> int main(){ int n,num,i; int big; printf("Enter the values of n: "); scanf("%d",&n);
Continue reading ...