Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool LinkedList<T>::addAtEnd(T ele)
- {
- bool bSuccess = false;
- Node<T> *t = new Node<T>;
- t->SetData(ele);
- if(empty())
- {
- t->SetNext(NULL);
- head = t;
- tail = t;
- count++;
- bSuccess = true;
- }
- else
- {
- t->SetNext(NULL);
- tail->SetNext(t);
- tail = t;
- count++;
- bSuccess = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement