Ejemplo n.º 1
0
        public CentroVacunacion()
        {
            listaPacientes      = new Lista <Paciente>();;
            tablaPaciente       = new TablaHash <int, Paciente>();
            avlPaciente         = new AVL <PacienteIndice>();
            avlPacienteApellido = new AVL <PacienteIndiceApellido>();
            avlPacienteNombre   = new AVL <PacienteIndiceNombre>();
            priodadPaciente     = new ColaDePrioridad();

            //Dar tamaño a la tabla hash, para cambiar tamaño hay que aumentar  las iteracions del for------------->
            for (int i = 0; i < 20; i++)
            {
                tablaPaciente.AgregarFinalLista();
            }
        }
Ejemplo n.º 2
0
        public void AgregarFinalLista()//Solamente va a servir para agregar nueva casilla hash
        {
            TablaHash <K, V> Nom2 = new TablaHash <K, V>();

            if (cantidadhash == 0)
            {
                AgregarInicioLista();
            }
            else
            {
                Ultimohash.Siguiente = Nom2;
                Ultimohash           = Nom2;
                cantidadhash++;
            }
        }
Ejemplo n.º 3
0
        //metodos para crear lista de lista
        public void AgregarInicioLista()
        {
            TablaHash <K, V> Nom1 = new TablaHash <K, V>();

            if (cantidadhash == 0)
            {
                Primerhash = Nom1;
                Ultimohash = Nom1;
                cantidadhash++;
            }
            else
            {
                TablaHash <K, V> temp = Nom1;
                temp.Siguiente = Primerhash;
                Primerhash     = temp;
                cantidadhash++;
            }
        }
Ejemplo n.º 4
0
 public TablaHash <K, V> Pos(int pos)
 {
     if (cantidadhash == 0 || pos == 0)
     {
         return(InicioLista());
     }
     else
     if (pos >= cantidadhash)
     {
         return(FinalLista());
     }
     else
     {
         TablaHash <K, V> temp = Primerhash;
         int cont = 0;
         while (cont < pos)
         {
             temp = temp.Siguiente;
             cont++;
         }
         return(temp);
     }
 }
Ejemplo n.º 5
0
 public TablaHash() //método constructor
 {
     Siguiente = null;
 }