Carta Seta
INICIO
Leer: m,n
f=1;f<=m; f++
c=1;c<=n;c++
Leer: M(f,c)
i=1;i<=m;i++
j=1;j <=n;j++
k=1;k <=m;k++
l=1;l<=n;l++M(i,j)<M(k,l)
Aux= M(i,j)
M(i,j)= M(k,l)
M(k,l)= Aux
f=1;f<=m; f++
c=1;c<=n;c++
Leer: M(f,c)
FIN
PROGRAMADO EN C++ - Matriz Ordenada – Método Burbuja#include<iostream.h>
#include<conio.h>
void main(){
int M[10][10],m,n;
textcolor(6);
clrscr();
cout<<"\n\t MATRIZ \n";
cout<<"\n Ingresar Cantidad de Filas <2...10>:";
cin>>m;
cout<<"\n Ingresar Cantidad de Columnas <2...10> :";
cin>>n;
//ingreso de valores
for (int f=1; f<=m; f++){
textcolor(f+10);
clrscr();
cout<<"\nIngesa Elementos de la Fila : "<<f<<endl;
for (int c=1;c<=n;c++){
cin>>M[f][c];
}
}
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
for(intk=1;k<=m;k++){
for(int l=1;l<=n;l++){
if (M[i][j]<M[k][l]){
int aux=M[i][j];
M[i][j]=M[k][l];
M[k][l]=aux; }
}
}
}
}
//MUESTRA LOS DATOS
for (int j=1;j<=m; j++){
cout<<endl;
for (int k=1;k<=n;k++)
cout<<" "<<M[j][k];
}
getch();
}
METODO DE SELECCION DIRECTA
INICIO
i=1; i<=n; i++
Leer: n
Leer: V(i)i=1; i<=n-1 ; i++
men = V(j)
posmen = j
men = V(i)
posmen = i
j=i+1; i<=n; i++
V(j) < men
V(posmen) = V(i)
V(i) = men
i=1; i<=n; i++
Escribir: V(i)
FINPROGRAMADO EN C++ - ORDENAMIENTO POR SELECCION DIRECTA
#include<iostream.h>
#include<conio.h>
void main(){
int v[10],n,i,j,p,men,posmen;
clrscr();
cout<<"\n\t ORDENAMIENTO MTODOSELECCION \n";
cout<<"\n ¨Cuantos Numero desea ingresar? <2...10> :";
cin>>n;
//ingreso de valores
cout<<"\n Ingresa los Valores : \n";
for (i=0; i<=n-1; i++){...
Regístrate para leer el documento completo.