示例#1
0
        }// Fim da função inserir

        public NohFila achaNoh(int data)
        {
            NohFila temp = start;

            while (temp != end)
            {
                if (temp.getData().Equals(data))
                {
                    break;
                }
                else
                {
                    temp = temp.getNext();
                }
            }
            if (temp == null)
            {
                return(null);
            }
            else if ((temp == end && !(temp.getData().Equals(data))))
            {
                return(null);
            }
            else
            {
                return(temp);
            }
        }
        private void bt4_Click(object sender, EventArgs e)
        {
            tbFila.Clear();
            NohFila temp = minhafila.start;

            if (minhafila.isEmpty())
            {
                tbFila.Clear();
                MessageBox.Show("Não há itens na Fila!", "Fila vazia");
            }

            else
            {
                while (temp != null)
                {
                    tbFila.Text = tbFila.Text + "  " + Convert.ToString(temp.getData());
                    temp        = temp.getNext();
                }
            }
        }