Sequential storage of linear tables means that the data elements in a linear table are stored sequentially with a contiguous set of storage cells, so that logically adjacent two elements are also adjacent to the physical location.
Sequential storage is a bit of a random access to the elements in the table, the disadvantage is that the insert and delete operations need to move elements. To move an element before inserting it to remove an empty storage cell, and then to insert an element, the delete operation also needs to move the element to fill the storage cell where the deleted element is empty.
Chained storage for linear tables is the use of nodes to store data elements.
In a chained storage structure, only one pointer, called the head pointer, is required to point to the first node, so that it can be accessed to any element of the table in a book order.
The time complexity of inserting nodes at the end of the team is O (1).
If you delete the first element node, you do not need to find its previous element, direct the head pointer to the next node and release the first node on the line, so the time complexity is O (1);
If you delete other ELEMENT nodes in the table, such as deleting K-node k is not the head node, look for the first K-1 element in the table and point the pointer to the element node, and then point the pointer to the K+1 element and delete the node K, so that the time complexity is O (n).
Recently just see a face question let you delete any node of the time complexity is O (1), look at the feeling a bit handsome, the code is not realized.
The method is: Suppose you want to delete A node, a.next==b. Delete B and assign the value of B to a, which is equivalent to deleting the endpoint a.