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. }





posted @ 2015-08-26 21:43  FeMiner  阅读(206)  评论(0编辑  收藏  举报