Storing a tree in a std::list<>
From: Dave (better_cs_now_at_yahoo.com)
Date: 06/06/04
- Next message: Daniel T.: "Re: first program evaluation"
- Previous message: Steven T. Hatton: "Re: Why code completion and early error checking are needed"
- Next in thread: Victor Bazarov: "Re: Storing a tree in a std::list<>"
- Reply: Victor Bazarov: "Re: Storing a tree in a std::list<>"
- Reply: Jeff Schwab: "Re: Storing a tree in a std::list<>"
- Reply: Alan Johnson: "Re: Storing a tree in a std::list<>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 5 Jun 2004 15:57:59 -0700
Hello all,
After perusing the Standard, I believe it is true to say that once you
insert an element into a std::list<>, its location in memory never changes.
This makes a std::list<> ideal for storing vertices of an arbitrary n-ary
tree where a vertex contain pointers to its parent / children. These parent
/ child vertices need to stay put if we've got pointers to them somewhere!
Am I correct in my assertion?
Thanks,
Dave
- Next message: Daniel T.: "Re: first program evaluation"
- Previous message: Steven T. Hatton: "Re: Why code completion and early error checking are needed"
- Next in thread: Victor Bazarov: "Re: Storing a tree in a std::list<>"
- Reply: Victor Bazarov: "Re: Storing a tree in a std::list<>"
- Reply: Jeff Schwab: "Re: Storing a tree in a std::list<>"
- Reply: Alan Johnson: "Re: Storing a tree in a std::list<>"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|