Insert a node at the head of a linked list

  • + 4 comments

    Node Insert(Node head,int x) {

    Node node1 =new Node();
    
    node1.data = x;
    node1.next= head;
    return node1;
    

    }