-
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)"
-
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.
-
Oh and linked lists are terrible, but I guess its a good mental exercise.
-
 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
-
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
-
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
-
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!
-
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|