#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

What do you mean by overloading?

0 Answers  


what is oops

4 Answers   DELL,


What is the example of polymorphism?

0 Answers  


define oops with class and object

5 Answers   HCL, Tech Mahindra,


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

0 Answers   CAT,






1.explicit call for destructor 2.calling function inside a constructor. 3.base *b-new derived delete b; 4.delete p what it will delete. 5.size of base class and derived class int i,in base class and int j in derived. 6.int i-20 int main() { int i =5; printf("%d".::i); { int i =10; printf("%d".::i); } } 7.object slicing 8.new 9.function overloading(return type). 10.class base() { virtuval fun() { ----- } } class derivied:public base() { fun() { ----- } } int main() { derived d; } 11.how static function will call in C++? 12.default structures are in C++? 13.constructors should be in public . 14.virtuval constructor not exist. 15.multilevel inhritence. destructor order.

1 Answers   Tech Mahindra,


What is the renewal class?

0 Answers   Ebix, IBM,


WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE

2 Answers  


Can you name some types of inheritance?

3 Answers   Motorola,


What are objects in oop?

0 Answers  


What Is a Polymorphism? How many types of polymorphism and whats that use in application?

2 Answers  


The type of variable a pointer points to must be the part of pointer's definition so that:

1 Answers   Infosys,


Categories