#include<stdio.h>
#include<string.h>
void main()
{
char name[10][10],temp[10];
int i,j,n,k;
printf("Enter number of names for inputing ::");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter Names ::");
scanf("%s",name[i]);
}
for(i=0;i<n-i;i++)
{
for(j=0;j<n-i-1;j++)
{
k=strcmp(name[j],name[j+1]);
if(k>0)
{
strcpy(temp,name[j]);
strcpy(name[j],name[j+1]);
strcpy(name[j+1],temp);
}
}
}
for(i=0;i<n;i++)
{
printf("\n%s",name[i]);
}
}
Internal sorting it means we are arranging the number within the array only which is in computer primary memory. External sorting it is the sorting of numbers from the external file by reading it from secondary memory.
distinguish extra element in two arrays
It is less efficient on list containing more number of elements. As the number of elements increases the performance of the program would be slow. Insertion sort needs a large number of element shifts.
Bubble sort is an "in place" algorithm. Other than a temporary "switch" variable, no extra space is required.
Marginal Product
Heaped cone as varied from half to level..
Time complexity Best case: The best case complexity of bubble sort is O(n). When sorting is not required, all the elements are already sorted. Average case: The average case complexity of bubble sort is O(n*n). It occurs when the elements are jumbled, neither properly ascending nor descending. Worst case: The worst-case complexity of bubble sort is O(n*n). It occurs when the array elements are needed to be sorted in reverse order. Space complexity In the bubble sort algorithm, space complexity is O(1) as an extra variable is needed for swapping.
It means the array has a sentinel to mark the end of the array. Any elements that follow the sentinel element are deemed invalid. Sentinels are usually denoted with a special value that is not used by any of the elements that precede it. Null-terminated strings are an example, where the NULL character (ASCII code 0) marks the end of a character array.
yes
unblocked it
No. It will cost you extra.
not possible