Linked List Design Theory....

This is a discussion on Linked List Design Theory.... within the C++ Programming forums, part of the General Programming Boards category; I have a class (Point.cpp/.h) that I am using to set and get two diffrent intergers. I am working on ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    131

    Linked List Design Theory....

    I have a class (Point.cpp/.h) that I am using to set and get two diffrent intergers. I am working on making a linked list of this class but I have a few question on proper design.

    1) Am I correct in thinking that I should put all the Linked List functions into a class of there own (i.e. LinkedList.cpp/.h).

    2) Were does the node go? Does it go in my Point class or my LinkedList class?

    3) When building the node does it get built in the .cpp file or the .h file?

    I have other question but they will be based off of the answers given.

    Thanks

    Chad

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Am I correct in thinking that I should put all the Linked List functions into a class of there own (i.e. LinkedList.cpp/.h).
    That's probably a good idea.

    [edit]
    Were does the node go? Does it go in my Point class or my LinkedList class?
    Probably in the LinkedList class.

    If this isn't homework, you can use the list data type. It's a ready-written linked list class.
    [/edit]
    Last edited by dwks; 11-02-2005 at 11:48 AM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    131
    Quote Originally Posted by dwks
    That's probably a good idea.
    Thats what I figured......

    So would my node be incorporated in the LinkedList.cpp file by incapsulating it in a struct or does it go in the class that is actually setting and getting the int.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Linked list program need help !!!
    By dcoll025 in forum C++ Programming
    Replies: 1
    Last Post: 04-20-2009, 10:03 AM
  2. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 03:09 AM
  3. Duplicating value of pointer to linked list
    By zephyrcat in forum C Programming
    Replies: 14
    Last Post: 01-22-2008, 02:19 PM
  4. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 08:27 PM
  5. 1st Class LIST ADT
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 06:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21