Results 1 to 2 of 2

Thread: How to reverse the order

  1. #1
    PetersonClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    202
    Rep Power
    3

    Default How to reverse the order

    I am Bsc(I.T) student. I am learning C programming language. In want to write a program to reverse the order of the letters using linked list? I tried differnt technique but not any of them worked out. Can anybody tell me how to do that.

  2. #2
    CollinsBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    213
    Rep Power
    3

    Default

    Try to understand following code which is given below.It is very simple code.

    Code:
    Node* ReverseList( Node ** List )	
    {
    	Node *temp1 = *List;
    	Node * temp2 = NULL;
    	Node * temp3 = NULL;
    	while ( temp1 )
    	{
    		*List = temp1; 	
    temps2= temps1->pNext; 
    		temp1->pNext = temp3;
    		temp3 = temp1;
    		temp1 = temp2;
    	}
     
    	return *List;
    }
    In the given code I have use ReverseList( ) function to invalidate the order of the letters using connected list. I also use while loop to do this.

Similar Threads

  1. C code for reverse the order of words in a string
    By HallMiller in forum Programming
    Replies: 2
    Last Post: 07-28-2010, 04:18 PM
  2. Program to reverse the order of words in a string
    By EvansMitchell in forum Programming
    Replies: 2
    Last Post: 07-07-2010, 02:05 PM
  3. I am going reverse to XP from Vista?
    By AndersonDiaz in forum Windows XP
    Replies: 2
    Last Post: 05-24-2010, 01:31 PM
  4. C program to reverse a number
    By Millerjames in forum Programming
    Replies: 1
    Last Post: 01-13-2010, 05:42 PM
  5. Configuring the reverse proxy (Layer 1)
    By carlos in forum Everything Else
    Replies: 0
    Last Post: 04-08-2009, 07:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48