Example #1
0
 public void print()
 {
     if (isEmpthy())
     {
         Console.WriteLine("A lista está vazia");
     }
     else
     {
         NohLista temp = new NohLista();
         temp = start;
         for (int i = 1; temp != null; i++)
         {
             Console.WriteLine(i + "°: " + temp.getInfo());
             temp = temp.getNext();
         }
     }
 }
Example #2
0
File: Form1.cs Project: Scdk/OOP
 private void printlist()
 {
     if (list.isEmpthy())
     {
         tbLista.Text = "";
     }
     else
     {
         string   str  = "";
         NohLista temp = new NohLista();
         temp = list.getStart();
         for (int i = 1; temp != null; i++)
         {
             str += " " + Convert.ToString(temp.getInfo());
             temp = temp.getNext();
         }
         tbLista.Text = str;
     }
 }
Example #3
0
        public int menor()
        {
            int      menor = start.getInfo();
            NohLista temp  = new NohLista();

            temp = start;
            for (int i = 0; temp != null; i++)
            {
                if (temp.getInfo() < menor)
                {
                    menor = temp.getInfo();
                    temp  = temp.getNext();
                }
                else
                {
                    temp = temp.getNext();
                }
            }
            return(menor);
        }
Example #4
0
 public void setEnd(NohLista newEnd)
 {
     start = newEnd;
 }
Example #5
0
 public void setStart(NohLista newStart)
 {
     start = newStart;
 }
Example #6
0
 public Lista()
 {
     start = null;
     end   = null;
 }
Example #7
0
File: NohLista.cs Project: Scdk/OOP
 public void setNext(NohLista newNext)
 {
     next = newNext;
 }
Example #8
0
File: NohLista.cs Project: Scdk/OOP
 public void setPrevious(NohLista newPrevious)
 {
     previous = newPrevious;
 }
Example #9
0
File: NohLista.cs Project: Scdk/OOP
 public NohLista(int value)
 {
     previous = null;
     next     = null;
     info     = value;
 }
Example #10
0
File: NohLista.cs Project: Scdk/OOP
 public NohLista()
 {
     previous = null;
     next     = null;
     info     = 0;
 }