Problem:Given a sorted circular linked list, insert a new node so that it remains a sorted circular linked list. Problem Link /* struct node { int data; struct node *next; }; */ void sortedInsert(struct node** head_ref, int x) { node *tmp=(*head_ref); node *prev,*nxt; int val; int start_val=tmp->data; bool first=1; node *p=new node; p->data=x; if(x<tmp->data) {
Continue Reading “Insert an element in a sorted circular linkedList.[Microsoft & Amazon]”