/* In this program we are creating an ascending order linked list */ #include #include struct node { int data; node *next; }; class linklist { private: node *start; node *current; node *previos; node *temp; public: linklist() { start=NULL; current=NULL; previos=NULL; temp = NULL; } void insert(int N) { current=start; temp = new node; temp -> data = N; temp -> next = NULL; if(start==NULL) { start = temp; } if(N < start->data) // to change order first change this sign { temp->next=start; start = temp; } else { while(current!=NULL && current->data <= N) // then change this sign { previos = current; current = current->next; } previos->next = temp; temp->next = current; } } void LRead(void) { while(start!=NULL) { cout<data<next; //copy the address of next node in start } } }; void main(void) { clrscr(); linklist r; cout<<"========== Priority Linked List ======="<