#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
difference between overloading and overridding
What are callback functions in c++
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
When is an object created and what is its lifetime?
What are the valid types of data that the main () can return in C/C++ language
Can we call a base class method without creating instance?
How to create a comment page in C #??
What is coupling in oops?
Why is polymorphism important in oop?
what is a ststic variable and stiticfunction briefly explain with exmple and in which case we use
What does and I oop and sksksk mean?
What is a null tree?