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

Popular posts from this blog

How do you convert a timestamp into a datetime in python with the correct timezone? -

how to display 2 form fields on same line with bootstrap -

c# - how to use buttonedit in devexpress gridcontrol -