#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
create a c++ program that will accepts 9 inputs using 3 by 3 array.
What is the difference between abstraction and polymorphism?
what is the difference between javap and jad utility
Why do we use class?
What is object-oriented programming? Webopedia definition
Out of 4 concepts, which 3 C++ Follow?
What type of loop is a for loop?
what is inline function?
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,
What is oops and its features?
What does and I oop mean in text?
Can you inherit a private class?