Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to delete the node at the end (tail) of the Linked List ?

Reply
Thread Tools

How to delete the node at the end (tail) of the Linked List ?

 
 
Sumika
Guest
Posts: n/a
 
      07-15-2005
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);
}

 
Reply With Quote
 
 
 
 
Artie Gold
Guest
Posts: n/a
 
      07-15-2005
Sumika wrote:
> Hello,
> I'm a newbie here, so don't know much friends.


And, alas, it seems you don't know where you are.

> 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)


And, since this is not C code, you're in the wrong place.

[What *is* this, anyway....]

Please post in an *appropriate* forum.

HTH,
--ag

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      07-15-2005
Sumika wrote:
> Hello,
> I'm a newbie here, so don't know much friends.


That may explain why no one told you that comp.lang.c is not the place
for your question because ...

> private void btnDeleteRear_Click(object sender, System.EventArgs e)


This is obviously C++ (or some near relative) and not C.
C++ questions belong in <news:comp.lang.c++>

They may be able to help you. You can make it easier on them if you
don't use so much white space in your code (if that's because you are
using tabs, don't; there's no real excuse for that any more). Also be
sure to check their FAQ before posting. In the past it was considered
good manners to lurk for several weeks before posting. This allowed you
to see what kinds of questions were asked and to see the postings of
either the FAQs themselves or links to them. You can accomplish the
same thing virtually by using groups.google.com to check past postings.
This has the additional benefit of allowing you to search for the
possibility that your questions have already been asked and answered.
 
Reply With Quote
 
Tydr Schnubbis
Guest
Posts: n/a
 
      07-15-2005
Sumika wrote:
> 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


try here:
news:microsoft.public.dotnet.languages.csharp
 
Reply With Quote
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      07-15-2005
Sumika wrote on 15/07/05 :
> 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.


It's an algorithm issue. The answer is not language-dependent.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"There are 10 types of people in the world today;
those that understand binary, and those that dont."

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Given only a pointer to a node to be deleted in a singly linked list, how do u delete it? ac.c.2k7@gmail.com C Programming 10 04-16-2007 06:36 AM
Given only a pointer to a node to be deleted in a singly linked list, how do u delete it? ac.c.2k7@gmail.com C++ 10 04-16-2007 06:36 AM
how to delete last node of a Linked list if you only know the address of last node. sangram C Programming 16 12-01-2006 08:57 PM
Delete node from singly linked list when header is not known Raj C++ 13 02-02-2006 06:21 AM



Advertisments