示例#1
0
        public Dados[] Imprimir()
        {
            if (this.primeiro == this.ultimo)
            {
                return(null);
            }

            Dados[]  v   = new Dados[tamanho];
            Elemento aux = this.primeiro.prox;

            for (int i = 0; i < v.Length; i++)
            {
                v[i] = aux.d;
                aux  = aux.prox;
            }

            return(v);
        }
示例#2
0
        public Dados Retirar(string n)
        {
            Elemento aux  = this.primeiro;
            Elemento aux2 = aux.prox;

            while (aux2 != null)
            {
                if (aux2.Equals(n))
                {
                    aux.prox  = aux2.prox;
                    aux2.prox = null;
                    return(aux.d);
                }
                else
                {
                    aux  = aux.prox;
                    aux2 = aux.prox;
                }
            }
            return(null);
        }
示例#3
0
 public Elemento(Dados d)
 {
     this.d    = d;
     this.prox = null;
 }
示例#4
0
 public Lista()
 {
     this.primeiro = new Elemento(null);
     this.ultimo   = this.primeiro;
 }