ohhh yes it do not have you can use insert after in it it is in the link i provided you
Complexity of the linkedlist
there are do many stl like list - vector forward list queue deque … you can google and learn about them .
is it ok ? will you be able to do it?
@vatsal38 sorry for asking to many question . but i am confused although i read the article but not able to understand the two like of code
forward_list<
int
>::iterator ptr;
here what does :: iterator ptr why?
ptr = flist.insert_after(flist.begin(), {1, 2, 3}); and the args ?
what i have to insert the one elements ?
it all comes under iterator you have to study it first otherwise wont be able to explain. you can simple use vector or list it supports push back. best choice would be vector @Vikaspal
its ok i know that you are confused just take it one at a time focus on list and vector dont use forward list because all its functions can be implemented with vector or list easily. i also never used forward list came to know about it by you only😃
@vatsal38 yes the list is like the doubly LL to have to take care of the both the pointer prev and next one
just write the name of stl which you want functions of and gfg afterwards like
list stl gfg
vector stl gfg …
@Vikaspal