参考文献
https://blog.youkuaiyun.com/weixin_43744293/article/details/117651551
https://www.cnblogs.com/james6176/p/4021741.html
这是一段希望在temp指向的元素左插入(z==0)和else右插入的·代码
if (z == 0)
{
L.insert(temp, x);
Locate[x] = --temp;
}
else
{
L.insert(++temp, x);
Locate[x] = --temp;
}
使用Locate[x]存储下x的迭代器值
迭代器并不是像指针地址那样一定为连续的数,插入值后,迭代器++,指向的就是逻辑上的下个数据而不是原来的那个数据。所以两次都是temp--都没有毛病。