Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void split(node* t, node* &p, int n)
- {
- n--;
- while(t && n)
- t = t->next;
- p = t->next;
- t->next = 0;
- }
- void copyl(node* t, node* &p)
- {
- p = t;
- node* q = p;
- while(t)
- {
- q = t;
- t = t->next;
- q = q->next;
- }
- }
- void del_even(node* &t)
- {
- node* p = t;
- while(p)
- {
- if(!(p->data % 2))
- delete_info(p, p->data);
- p = p->next;
- }
- }
- void del_odd(node* &t)
- {
- node* p = t;
- while(p)
- {
- if(p->data % 2)
- delete_info(p, p->data);
- p = p->next;
- }
- }
- void split_evod(node* &t, node* &p)
- {
- copyl(t, p);
- del_even(t);
- del_odd(p);
- }
Advertisement
Add Comment
Please, Sign In to add comment