#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

Post New Answer

More OOPS Interview Questions

create a c++ program that will accepts 9 inputs using 3 by 3 array.

1 Answers  


What is the difference between abstraction and polymorphism?

0 Answers  


what is the difference between javap and jad utility

1 Answers   Wipro,


Why do we use class?

0 Answers  


What is object-oriented programming? Webopedia definition

0 Answers  






Out of 4 concepts, which 3 C++ Follow?

1 Answers   TCS,


What type of loop is a for loop?

0 Answers  


what is inline function?

3 Answers  


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?

0 Answers  


What does and I oop mean in text?

0 Answers  


Can you inherit a private class?

0 Answers  


Categories