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(); } } }
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; } }
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); }
public void setEnd(NohLista newEnd) { start = newEnd; }
public void setStart(NohLista newStart) { start = newStart; }
public Lista() { start = null; end = null; }
public void setNext(NohLista newNext) { next = newNext; }
public void setPrevious(NohLista newPrevious) { previous = newPrevious; }
public NohLista(int value) { previous = null; next = null; info = value; }
public NohLista() { previous = null; next = null; info = 0; }