linked lists [was: its urgent]


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: linked lists [was: its urgent]

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Unhappy linked lists [was: its urgent]

    Hi people of this site. I am new in this site. I have to submit an assignment in visul C before 21 june. So please please people help me.
    The topic is

    " For a given number of people, write a C program to simulate Joseph problem. (You must use circular queue mantained using double link list)"

  2. #2
    Join Date
    Dec 2003
    Posts
    3,366
    I think you missed the "read before posting" message, its at the top of the thing. I will repeat the important lines here:
    _________________________________
    Homework help will be tolerated only if the poster shows significant interest and past effort in having worked on the problem already and questions are narrowly posed. It is acceptable to ask for help to get past a hurdle in your exercise, but do not post an exam question and expect the community to provide the answer.

  3. #3
    Join Date
    Dec 2003
    Posts
    3,366
    Oh and linked lists are terrible, but I guess its a good mental exercise.

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    Quote Originally Posted by jonnin
    Oh and linked lists are terrible, but I guess its a good mental exercise.
    Why do you think so? There are just two pointers to update instead of only one as in the normal linked list. Just curious.
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  5. #5
    Join Date
    Nov 2003
    Posts
    4,118
    Updating the pointers is not the problem; it's the very idea of managing memory manually. Using std::list is so much simpler in comparison.
    Danny Kalev

  6. #6
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    gotcha.
    I agree, but I still think that at least at school people have to learn memory managment, and the double linked list is a good opportunity to learn it (sorry if I sound like an old teacher)
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  7. #7
    Join Date
    Nov 2003
    Posts
    4,118
    Quote Originally Posted by mstraf
    gotcha.
    I agree, but I still think that at least at school people have to learn memory managment, and the double linked list is a good opportunity to learn it (sorry if I sound like an old teacher)
    Marco
    I certainly agree with this educational approach. However, the paradox is that some students try to copy others' linked lists so the end result is that the neither learn anything from it nor use a proper linked list data structure in their programs.

    The importance of learning memory management can't be over-emphasized. However, in production code, I prefer to see STL containers rather than handmade data structures.
    Danny Kalev

  8. #8
    Join Date
    Dec 2003
    Posts
    3,366
    Right -- its a good mental exercise. I also hate lists because they page fault constantly (if done in old school "new each element" fashion) and you have to iterate to find things. They are a performance nightmare!

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