|
From: S. M. H. <Mit...@an...> - 2005-12-19 06:19:34
|
lordSauron wrote: > On 12/17/05, Jason Benjamin <red...@ya...> wrote: > >>What is the use of pointers, linked lists, >>polymorphism,and operator overloading? > [....] > I don't know anything about linked lists yet, so I can't speak for that. I think of linked lists as "homogeneous array elements not contiguous in memory" (homogeneity of the array elements is not strictly required, but is typical). I believe they are generally useful at runtime, in which structures are dynamically allocated and de-allocated when necessary, and it is considered less efficient to allocate large memory blocks at initialization in anticipation of your memory needs. Singly linked lists would be useful if there is a continual need to enumerate data in each "record" (that is the structure containing its fields); doubly linked lists would useful in case a lot of record/data searching is done and the list data has been ordered/sorted with each addition of a link. There are various strategies for the efficient use of linked lists. One allocate linked lists of arrays as a means of joining the end of one array to the start of a newly allocated memory block of that same array type. |