First, we let the elements of the array consist of two data fields, and cur. In other words, each subscript of an array corresponds to a data and a cur.
The data field is used to hold the data element, which is usually the data we want to process, while the cursor cur corresponds to the next pointer in the single list, and holds the subscript of the element's successor in the array. We call this list of arrays described as static lists.
The first element of the array, the cur of the element with subscript 0, holds the subscript of the first node of the standby list; The cur of the last element of the array holds the subscript of the first element with a numeric value, which corresponds to the function of the head node of a single linked list, and 0 when the whole list is empty, indicating no point. As shown in Figure 3-12-2
Now if we need to insert a value of "C" between "B" and "Ding", we just need to change the cur of "B" to 7, which means that the next one is "C", and the cur of "C" is changed to 4, which means that the next one is ding.
As shown in Figure 3-12-3.
Now if we delete the first element "a", it means that the position "a" is now empty, if there are new people to come in the future is preferred here, so the deletion of the position becomes the first priority, that is, the first element of the CUR is 1, the first element position of the cur to 8, and the subscript 8 position cur change to 9, The cur of the last element position is changed to 2, as shown in Figure 3-12-4.