arrays - Memory space consumption -
is there situation memory space taken linked list pointers more memory consumed array same problem if problem can solved both structures?
a linked list dynamically sized data, inserts , removes. typically on heap. comparing array mean array uses strategy being oversized unused entries inserts, , being reallocated if arrays threatens overflow.
so depends on actual array strategy , behavior of program, knowledge of it.
however every entry actual data needs space too, maybe pointer , allocated object. @ linked-list overhead form of indexing, in database. memory more or less irrelevant.
one should aware, instance linked list of booleans not clever.
Comments
Post a Comment