#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 type of question are asked in thoughtworks pair programming round ?
program for insertion ,deletion,sorting in double link list
Write a c++ program to display pass and fail for three student using static member function
What is inheritance in oop?
explain sub-type and sub class? atleast u have differ it into 4 points?
why freind function takes more parameter than normal member function in c++?
Why oops is important?
Write a program to multiply 3x3 matrics
what is virtual function in c++
What does and I oop and sksksk mean?
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash