Linked stack

Hi, this semester we are studyinng Data structures in c++. Last time we studied linked stack /the one with the pointers /we said it is like nodes//, I used the standard library in c++
#include <stack>

but do we have a standard linked stack library and I have to implement it? Thanks in advance.
Also wanted to ask: we have a standard libraby <forward_list> - that is for the single list, but I know that there is double linked list, do we have double list standard library. I found a library <list> is this the double list?
https://www.cplusplus.com/reference/forward_list/forward_list/
Forward lists are implemented as singly-linked lists; Singly linked lists can store each of the elements they contain in different and unrelated storage locations. The ordering is kept by the association to each element of a link to the next element in the sequence.


https://www.cplusplus.com/reference/list/list/
List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they contain in different and unrelated storage locations. The ordering is kept internally by the association to each element of a link to the element preceding it and a link to the element following it.
Okay, thank you.

Anyone something about the linked stack?
Your linked stack is a linked list where only one end it used. I suggest you take a look at salem c's post again.
A double linked list is a multi-purpose data structure.

You can use it as an arbitrary list.

You can use it as a queue, if you only append to one end, and only remove from the other end.

You can use it as a stack, if you only use one end for adding (aka push) and removing (aka pop).
Topic archived. No new replies allowed.