Linked list related issue

why do we use dynamic allocation in linked list??

Hey @guptakeshav885
Please elaborate your question

otherwise
say this is class node

class node{
       int data;
       node*next;//to point to next node
}; 

now when enevr we create a node
we use
node*head =new node;
See new is used to allocate memory dynamically

Oh sorry I read your question as where we use

So we use dynamic allocation for linked list because we want it to be flexible with expanding as much as we want it to during runtime .