Posts

Showing posts from September, 2020

Complete Circular Singly Linked List C++

 #include<bits/stdc++.h> using namespace std;  struct node  {      int data;      struct node * next;  };  struct node *head, *newnode, *tail, *temp, *stemp;  int count=0,f=1; // f==1 means that list is not created or became empty  void create()  {      head =0;      tail=0;      int choice=1;      while(choice==1)      {          ::count++;          newnode=(struct node*)malloc(sizeof(struct node));          cout<<"enter data";          cin>>newnode->data;          if(head==0)          {              head=newnode;              tail=newnode;              newnode->next=ne...