Thread: single linked list to double linked list (help)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    19

    single linked list to double linked list (help)

    I'm telling you I can't stand online programming courses in college, but what choice do I have? I have no live instructor. Its very difficult.

    I have an assignment. Convert a linked list to a double linked list. Nothing in my book on how to do this. I'm supposed to research how myself.

    The list I have to convert is pretty long, but I pray that there is someone out there with the patience to help me. I'm desperate.

    Here is the single linked list I need to convert. Too long to paste here.

    URL deleted. The list in question is Fig 12.3 in Chapter 12 of C How to Program 5th edition by Deitel.

    The only thing I understand is that the double linked list should be able to go forward and backward. What exactly does that mean in my case? When I insert a character into the list, I go forward, when I delete a character, I go backward. What would a double linked list do different?

    This is the only clue my professor gave me.

    Code:
    You should add a print backwards to prove that the list works in reverse. 
    
    You must remove the previous node in the insert and delete routines and use the previous pointer instead. 
    
    A node structure for a doubly linked list is: 
    
    
    struct Node{  int data;/ this can be any type data  Node *next;  Node *prev; }
    Can someone please explain this to me?
    Last edited by Countfog; 04-29-2008 at 08:29 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  2. help! Placement of nodes in a Linked List
    By lostmyshadow in forum C Programming
    Replies: 6
    Last Post: 12-17-2007, 01:21 PM
  3. Linked list with two class types within template.
    By SilasP in forum C++ Programming
    Replies: 3
    Last Post: 02-09-2002, 06:13 AM
  4. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM