Bubble sort is the simplest sorting algorithm. In this technique we follow given step to short given elements in increasing order.
http://www.tutorial4us.com/data-structure/c-bubble-sort
Ingeniería en Sistemas Computacionales
Simulación
Algoritmo congruencial cuadrático
Programa que genera una serie de números pseudoaleatorios basándose en el algoritmo congrencial cuadratico, al final los muestra en pantalla.
Bubble sort is the simplest sorting algorithm. In this technique we follow given step to short given elements in increasing order.
http://www.tutorial4us.com/data-structure/c-bubble-sort
Ingeniería en Sistemas Computacionales
Simulación
Algoritmo congruencial cuadrático
Programa que genera una serie de números pseudoaleatorios basándose en el algoritmo congrencial cuadratico, al final los muestra en pantalla.
1. /*System.out.println(""Una nota"");
System.out.println("Hola Mundo");
String i ="4";
System.out.println("El valor de i es: "+i);
System.out.println(i);
int n = 12;
char x ='w';
System.out.println(n);
System.out.println("El valor de x es: " + x);
double j = 1.0 / 2.0;
System.out.print("j es: ");
System.out.println(j);
int h = 0;
int e = 2;
while(h <= 10)
{
System.out.println(++h);
if(h != 2 && h != 4 && h%2 == 0)
{
2. break;
}
}
String p = (h == 4)? "Listo":"Fallo";
System.out.println(p);
BufferedReader datosEntrantes = new BufferedReader( new
InputStreamReader(System.in) );
String nombre = "";
System.out.println("Escribe tu nombre, Por Favor!!");
try
{
nombre = datosEntrantes.readLine();
}
catch (IOException ex)
{
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
System.out.println("Error!!");
}
System.out.println("Hola " + nombre + "!!");
int[] a= new int [10];
3. a[0] = 7;
a[1] = 9;
a[2] = 6;
a[3] = 3;
a[4] = 1;
a[5] = 8;
a[6] = 2;
a[7] = 4;
a[8] = 5;
a[9] = 0;
for(int g =0; g < a.length - 1 ; g++)
{
System.out.println("La posicion " +(g + 1) +" es igual a ="+ a[g]);
}
for(int k = 0; k < a.length -1; k++)
{
int min = k;
for(int l = k + 1;l < a.length; l++)
{
4. if(a[l] < a[min])
{
min = l;
System.out.println("0");
}
System.out.println("a");
}
if(k != min)
{
int aux = a[k];
a[k] = a[min];
a[min] = aux;
System.out.println("b");
}
System.out.println("c");
}
System.out.println("");
for(int m = 0;m < a.length;m++)
{