S
Sumika
Hello,
I'm a newbie here, so don't know much friends.
I've problem deleting my node at the tail, so could you all help me to
solve my error,I worked on it for quite sometime but it just can't work.
Thanks
The following is my code:
private void btnDeleteRear_Click(object sender, System.EventArgs e)
{
for(Node h = head; h != null; h = h.Link )
{
if(h.Link == tail) // Linked List is not empty
{
//tail.Link = this.tbxNum.Text;
//tail.Link = new Node (this .tbx1.Text, null);
tail = null;
}
else //When Linked List is empty.
{
this.tbxNum.Text = tail.Link.ToString();
//Make head point to this first node.
}
size--;
this.lblNum.Text= size.ToString();
this.Visualize(head);
}
I'm a newbie here, so don't know much friends.
I've problem deleting my node at the tail, so could you all help me to
solve my error,I worked on it for quite sometime but it just can't work.
Thanks
The following is my code:
private void btnDeleteRear_Click(object sender, System.EventArgs e)
{
for(Node h = head; h != null; h = h.Link )
{
if(h.Link == tail) // Linked List is not empty
{
//tail.Link = this.tbxNum.Text;
//tail.Link = new Node (this .tbx1.Text, null);
tail = null;
}
else //When Linked List is empty.
{
this.tbxNum.Text = tail.Link.ToString();
//Make head point to this first node.
}
size--;
this.lblNum.Text= size.ToString();
this.Visualize(head);
}