Data Structures/Linked List/circularLL.cpp
// Insertion in between is exactly same as that of linear one

Insertion in between is exactly same as that of linear one
Insertion in between is exactly same as that of linear one
void List::insert_middle()
{
    Node *new_node = new Node;
    int pos;
    std::cout << "Enter data : " << std::endl;
    std::cin >> new_node->data;
    std::cout << "Enter position: " << std::endl;
    std::cin >> pos;
    temp = listptr;
    for (int i = 0; i < pos - 1; i++)
    {
        temp = temp->next;
    }
    new_node->next = temp->next;
    temp->next = new_node;
}
void List :: insert_middle ( ) { Node * new_node = new Node ; int pos ; std :: cout << " " << std :: endl ; std :: cin >> new_node -> data ; std :: cout << " " << std :: endl ; std :: cin >> pos ; temp = listptr ; for ( int i = 0 ; i < pos - 1 ; i ++ ) { temp = temp -> next ; } new_node -> next = temp -> next ; temp -> next = new_node ; }
Insertion in between is exactly same as that of linear one
Insertion in between is exactly same as that of linear one