_size++;
}
- sllnode<_Tp>add_front(_Tp val) {
+ sllnode<_Tp>* add_front(_Tp val) {
sllnode<_Tp> * tmp = new sllnode<_Tp>();
tmp->prev = NULL;
tmp->next = head;
_size=0;
}
- void insertAfter(sllnode<_Tp> * node, _Tp val) {
+ sllnode<_Tp> * insertAfter(sllnode<_Tp> * node, _Tp val) {
sllnode<_Tp> *tmp = new sllnode<_Tp>();
tmp->val = val;
tmp->prev = node;
tmp->next->prev = tmp;
}
_size++;
+ return tmp;
}
void insertBefore(sllnode<_Tp> * node, _Tp val) {