Example #1
0
    public void DodajNaKoniec(object info)
    {
        wezel newwezel = new wezel();

        newwezel.Value     = info;
        AktualnyWezel.Nast = newwezel;
        AktualnyWezel      = newwezel;
        IloscElementowWLiscie++;
    }
Example #2
0
    public void DodajNaPoczatku(object info)
    {
        wezel newwezel = new wezel()
        {
            Value = info
        };

        newwezel.Nast = glowa.Nast;
        glowa.Nast    = newwezel;
        IloscElementowWLiscie++;
    }
Example #3
0
    public void WypiszListe()
    {
        Console.Write("glowa -> ");
        wezel teraz = glowa;

        while (teraz.Nast != null)
        {
            teraz = teraz.Nast;
            Console.Write(teraz.Value);
            Console.Write(" -> ");
        }
        Console.Write("Koniec\n");
    }
Example #4
0
 public void UsunZKonca()
 {
     if (IloscElementowWLiscie > 0)
     {
         AktualnyWezel.Poprz.Nast = null;
         AktualnyWezel            = AktualnyWezel.Poprz;
         AktualnyWezel.Nast       = null;
         IloscElementowWLiscie--;
     }
     else
     {
         Console.WriteLine("Lista jest Pusta");
     }
 }
Example #5
0
 public void UsunZKonca()
 {
     if (IloscElementowWLiscie > 0)
     {
         wezel teraz = glowa;
         while (teraz.Nast != AktualnyWezel)
         {
             teraz = teraz.Nast;
         }
         teraz.Nast = null;
     }
     else
     {
         Console.WriteLine("Lista jest Pusta");
     }
 }
Example #6
0
 public List()
 {
     glowa         = new wezel();
     AktualnyWezel = glowa;
 }