Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTiagoCosta

Posted 13 September 2013 - 03:10 PM

The only good reason to use linked lists is, IMO, if the size of the array isn't fixed and you have to resize it very frequently

Or if you need to insert or remove elements in the middle of the array very frequently while keeping the overall order of the elements (if the order doesn't matter removing an entry from an array is as easy as copying the last element to the position that you want to remove and decrement the size).

 

Most of the time (always) arrays will be faster due to better cache utilization and direct access to elements.


#2TiagoCosta

Posted 13 September 2013 - 03:08 PM

The only good reason to use linked lists is, IMO, if the size of the array isn't fixed and you have to resize it very frequently

Or if you need to insert or remove elements in the middle of the array very frequently while keeping the overall order of the elements (if the order doesn't mater removing an entry from an array is as easy as copying the last element to the position that you want to remove and decrement the size).


#1TiagoCosta

Posted 13 September 2013 - 03:07 PM

The only good reason to use linked lists is, IMO, if the size of the array isn't fixed and you have to resize it very frequently

Or if you need to insert or remove elements in the middle of the array while keeping the overall order of the elements very frequently (if the order doesn't mater removing an entry from an array is as easy as copying the last element to the position that you want to remove and decrement the size).


PARTNERS