Thank you for your attention.your are so nice.
With the help of my friend, I understand the second half of your content (from Here’s @warsoldier011’s excerpt adapted …… to the end). 
Maybe I didn’t make it clear that the order of elements couldn’t be changed.My friend reminded me to use a linked list。