#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
void insert(char *items, int count);
int main(void)
{
char s[255];
printf("Enter a string:");
gets(s);
insert(s, strlen(s));
printf("The sorted string is: %s.\n", s);
getch();
return 0;
}
void insert(char *items, int count)
{
register int a, b;
char t;
for(a=1; a < count; ++a)
{
t = items[a];
for(b=a-1; (b >= 0) && (t < items[b]); b--)
items[b+1] = items[b];
items[b+1] = t;
}
}
design an algorithm for Insertion Sort
No Answer is Posted For this Question
Be the First to Post Answer
What is data binding in oops?
Why we are use # in begning of programme of c++.
WAP to generate 2n+1 lines of the following pattern on the computer screen:
officer say me - i am offered to a smoking , then what can you say
Difference between realloc() and free?
what is the difference between a package and a software?
what is namespace? what are the uses of namespace?
What is this pointer in oop?
WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.
what are the ways in which a constructors can be called?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
what is pointers