5 Implementation comparison

Out of the three discussed implementation methods, linked list is the most common one. This is because the linked list implementation permits flexible and efficient methods to insert new nodes, or delete existing nodes. In some ways, it is also less complex and more intuitive.

With the linked list implementation, care must be taken when lists are spliced and merged. Memory corruption can occur if an object pointed to by two sources is deleted, but only one source is aware of the deletion. Memory leak can occur if an object is no longer accessible by any named variable sources. Both memory corruption and leak can happen when linked lists are used incorrectly.


Copyright © 2006-09-27 by Tak Auyeung