3.3 循环链表

                                                 循环单向链表

                             图(a)添加头节点                                                                                      图(b)添加尾节点
  1. void addToTail(int el) {
  2. if (isEmpty()) {
  3. tail = new IntSLLNode(el);
  4. tail->next = tail;
  5. }
  6. else {
  7. tail->next = new IntSLLNode(el,tail->next);
  8. tail = tail->next;
  9. }
  10. }





原文地址:https://www.cnblogs.com/star91/p/4761755.html