#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 sub classing in c++?
what is the difference between function template and template of function?explain with example.
what is difference between c++ language and java language
diff between Abstract class Interfaces?
how to tackle technical questions
What is object and example?
difference between structure and union.
What does oop mean in snapchat?
What makes a language oop?
What are the benefits of interface?
What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?
Templates mean