A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
Reverse a linked listThis code shows the logic behind reversing a linked list in C++ using pointers and looping through the current nodes, changing the order in which the elements are linked to eachother. |
On Tuesday, November 6th 2007 at 11:20 PM By Andrew Pociu (View Profile) ![]() ![]() ![]() ![]() (Rated 2.7 with 6 votes) |
||
|
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current Comments//set head to next node
currHead = currNode->next
is correct way.
void linklist::reverse()
{
node *curr = p, *prev = NULL, *nxt_fwd = NULL;
//p is header
while(curr)
{
nxt_fwd = curr->link;
curr->link = prev;
prev =curr;
curr=nxt_fwd;
}
p = prev; /*save the new head */
}
currHead=revList;
it's need to be outside the while
I think this is a working recursive solution:
Node * reverse(Node* previous=NULL, Node* head, Node* next)
{
head->child = previous
if(next==NULL)
return head;
else
return reverse(head,next,next->child);
}
i have to study ,......
HELLO HELLO HELLO !!!
The coding given at the top(by the site owner) is completely incorrect.
Anyone can dry-run it and find that it will not work.
well it's worked withe my correction ,U probably have some other problem.
it is a chuss tatorial.chuss e oyeeeeeeeeeeeeee
Its a junk code. Not working
Related Source Code
Related Tutorials
C++ Job Search