10. Linked List/cpp/INSERTION AT PARTICULAR POSITION.cpp
void insert_at_particular_postion(Node** current, int pos, int data)
{
    
    if (pos < 1 || pos > size + 1)
        cout << "Invalid position!" << endl;
    else {
 
        while (pos--) {
 
            if (pos == 0) {
                Node* temp = getNode(data);
                temp->next = *current;
                *current = temp;
            }
            else
              current = &(*current)->next;
        }
        size++;
    }
}
// FUNCTION TO INSERT AT PARTICULAR POSITION
FUNCTION TO INSERT AT PARTICULAR POSITION
FUNCTION TO INSERT AT PARTICULAR POSITION
void insert_at_particular_postion(Node** current, int pos, int data)
{
    if (pos < 1 || pos > size + 1)
        cout << "Invalid position!" << endl;
    else {
        while (pos--) {
            if (pos == 0) {
                Node* temp = getNode(data);
                temp->next = *current;
                *current = temp;
            }
            else
              current = &(*current)->next;
        }
        size++;
    }
}
void insert_at_particular_postion ( Node * * current , int pos , int data ) { if ( pos < 1 || pos > size + 1 ) cout << " " << endl ; else { while ( pos -- ) { if ( pos == 0 ) { Node * temp = getNode ( data ) ; temp -> next = * current ; * current = temp ; } else current = & ( * current ) -> next ; } size ++ ; } }
FUNCTION TO INSERT AT PARTICULAR POSITION
FUNCTION TO INSERT AT PARTICULAR POSITION