Home > Back-end >  To solve the
To solve the

Time:09-22

1) function for the input/output array, call son sort function complete sorting; Son sort () function (int * a, int n) is the function of address led to a continuous descending order n integers,
2) 10 integer input from the keyboard, write a program with bubble sort method 3-6 digits of the number ten descending order, the requirement for function of the main function of the input/output array, call son sort function complete sorting; Son sort () function (int * a, int n) function ditto,
A element with 10, 3) array is arranged in ascending order, from numerical keyboard input from the keyboard input 10 integers, write a program using the selection method of the number of ten descending order, request the main function variable x, and by using the sequential search method to find position of x (subscript), such as there is no x value, output "Not found",
A element with 10, 4) array is arranged in ascending order, from the keyboard input values stored in the variable x, using binary search to find the location of the x (subscript), such as there is no x value, output "Not found",

CodePudding user response:

Void the sort (int * a, int n)
{
for(int i=0; i{
For (int j=I; j{
If (a [I] {
Int temp=a [I];
A [I]=a, [j].
A [j]=temp;
}
}
}
}
  • Related