Merging is the process of combining two or more sorted arrays into a third sorted array. We can use this technique to sort an array of n elements as follows.
Divide the array into ‘n’ sub arrays of size 1 and merge adjacent pairs of sub arrays. Then we can have approximately n/2 sorted sub arrays [...]
Merge Sort implementation in C
Circular Queue Data Structure with implementation in C
A circular queue is a Queue but a particular implementation of a queue. It is very efficient. It is also quite useful in low level code, because insertion and deletion are totally independant, which means that you don’t have to worry about an interrupt handler trying to do an insertion at the same time as [...]
Full Story »Queue Data Structure with implementation in C
A queue is a buffer abstract data structure providing services in computer science, transport and operations research where various entities such as data, objects, persons, or events are stored and held to be processed later. The most well known operation of the queue is the First-In-First-Out (FIFO) queue process. In a FIFO queue, the first [...]
Full Story »Stacks Data Structure with implementation in C
One way to think about this implementation is to think of functions as being stacked on top of each other; the last one added to the stack is the first one taken off. In this way, the data structure itself enforces the proper order of calls. Conceptually, a stack is simple: a data structure that [...]
Full Story »Using Files In C Programming
This is a C program on file Handling
/************** File Handling *************/
void main()
{
FILE *file1;
char c;
int choice;
char op;
clrscr();
do
{
printf(“\t\tMenu\n\t1. Enter The Information\n\t2. Display The Information\n”);
scanf(“%d”,&choice);
switch(choice)
{
case 1:
printf(“\n Information \n”);
file1=fopen(“Handlin.doc”,”w”);
while((c=getchar())!=EOF)
{
putc(c,file1);
}
fclose(file1);
break;
case 2:
printf(“Information\n”);
printf(“Result :”);
file1=fopen(“Malcolm .doc”,”r”);
while((c=getc(file1))!=EOF)
printf(“%c”,c);
fclose(file1);
break;
default:
exit(1);
}
printf(“Enter Y To Continue:”);
flushall();
scanf(“%c”,&op);
}
while((op==’y’)(op==’Y’));
getch();
}
/********************* OUTPUT **********************
Menu
1. Enter The Information
2. Display The Information
1
Information
Today Is Sunday
^Z
Enter Y To Continue:y
Menu
1. Enter The Information
2. Display The Information
2
Information
Result :
Today Is Sunday
Enter Y To [...]
PROGRAMMING IN 'C'
Programming in ‘c’ is a commonly used concept in many software compinies.it mainly requires the following:-
Hadder File
main
data declaration
data initialization
body
getch