Inserting and deleting a value at a given point in the list


If a problem solution involves a dynamic list, then a linked list may be a more time efficient way to store and process that list. In a sequential-storage implementation, the values are stored in adjacent locations in an array. This means that when values are inserted into (or deleted from) an array-based list of n values, an average of nl2 of the values will have to be shifted to make room for the new value. The time required to shift these values makes insertion (and deletion) a time-expensive operation. By contrast, the values in a linked list are stored in (nonadjacent) nodes, which are attached to one another using links. Inserting (and deleting) a value at a given point in the list simply involves setting the values of (at most) two of these links.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Inserting and deleting a value at a given point in the list
Reference No:- TGS02584532

Expected delivery within 24 Hours