Answers for "how to use a new node c++"

C++
3

how to use a new node c++

struct node(){
  int key; 
  node *next;
  node(x){  
    key = x;
    next = NULL;     
}}
// after you take a input of a linked list .
// creating a new node.
node *temp = new node(key);  // tem pointer pointing towards the new node. 
temp -> next = head; // inserting the mew node in the start .
Posted by: Guest on June-26-2020

Browse Popular Code Answers by Language