Algorithm_fromBilibili icon indicating copy to clipboard operation
Algorithm_fromBilibili copied to clipboard

单向链表的尾插法

Open kirinenko opened this issue 1 year ago • 0 comments

void CreatListTail(LinkList &L, const size_t n) { Lnode *r = L; for (int i = 0; i < n; ++i) { Lnode *p = new Lnode; cin >> p->data; p->next = NULL; #这里是不是应该改成NULL,原来写的是r->next r->next = p; r = r->next; } }

kirinenko avatar Feb 06 '24 12:02 kirinenko