Metodos de busqueda en arreglos algoritmo

Solo disponible en BuenasTareas
  • Páginas : 3 (630 palabras )
  • Descarga(s) : 7
  • Publicado : 14 de mayo de 2010
Leer documento completo
Vista previa del texto
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Collections;
namespace Metodos_de_ordenamiento
{
class Program
{public static int encender()
{
int H = DateTime.Now.Hour;
int M = DateTime.Now.Minute;
int S = DateTime.Now.Second;
int Mili =DateTime.Now.Millisecond;
int HoraInicio = (H * 3600 + M * 60 + S) * 1000 + Mili;
return HoraInicio;
}
//-----------------------------------
public static intdetener()
{
int H = DateTime.Now.Hour;
int M = DateTime.Now.Minute;
int S = DateTime.Now.Second;
int Mili = DateTime.Now.Millisecond;int HoraFinal = (H * 3600 + M * 60 + S) * 1000 + Mili;
return HoraFinal;
}
public static int[] Burbuja(int[] matrix)
{

int temp;int t = matrix.Length;
for (int i = 1; i < t; i++)
{
for (int k = t - 1; k >= i; k--)
{
if (matrix[k] {
temp = matrix[k];
matrix[k] = matrix[k - 1];
matrix[k - 1] = temp;}//fin if
}// fin 2 for
}//fin 1 for
return matrix;


}

public static void Insercion(int[] v)
{for (int i = 1; i < v.Length; i++)
{
int aux = v[i];
int j;
for (j = i - 1; j >= 0 && v[j] > aux; j--)
v[j + 1]= v[j];
v[j + 1] = aux;
}
}

public static void selecccion(int[] a)
{
for (int i = 0; i < a.Length - 1; i++)
{...
tracking img