Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Node
- {
- struct Node *prev,*next;//ssilki
- char *elem; //str
- };
- struct List
- {
- struct Node *first,*last;// ssilkui
- };
- void process(List lst, string str){
- Node *cur,*nextc,*prevc;
- cur=lst.first;
- nextc=cur->next;
- prevc=cur->prev;
- while(cur!=lst.last){
- if(str == cur->elem){
- nextc->prev=cur->prev;
- prevc->next=cur->next;
- delete cur;
- }
- else if(cur->elem > str){
- lst.last->next=prevc->next;
- nextc->prev=cur->prev;
- prevc->next=cur->next;
- cur->prev=lst.last->prev->next;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement