dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    leonardo Guest

    doubly linked lists


    hi, I need to modify a doubly linked list program in order to convert it from
    using integers to using strings. I also need to create code so that the
    list of strings that I input is printed out in the same order I put them
    in. At the moment, the list comes out in reverse order. Anyone that can
    help with this, I would be humbly grateful. Thanx


  2. #2
    ralph Guest

    Re: doubly linked lists


    "leonardo" <justiceprevailss@hotmail.com> wrote:
    >
    >hi, I need to modify a doubly linked list program in order to convert it

    from
    >using integers to using strings.
    > ...


    Change your node item so that it now hold a pointer to a string.
    new the strings as they come in and assign the pointer. (Don't forget to
    delete the string when you delete the node.) Also note you will be handling
    and passing pointers not just a value.

    > ...
    >I also need to create code so that the
    >list of strings that I input is printed out in the same order I put them
    >in. At the moment, the list comes out in reverse order.
    > ...


    A double link-list holds a pointer to the 'next' and to the 'previous'.
    I sounds like it is now starting at the bottom and calling "node->previous".
    Add a routine to start at the top and call "node->next".

    Anyone that can
    >help with this, I would be humbly grateful. Thanx
    >


    Good Luck, and have fun. Trust me, when you are done, you will LOVE the STL.


  3. #3
    Alessandro Guest

    Re: doubly linked lists


    >> Trust me, when you are done, you will LOVE the STL.


    wise words my friend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center






×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.