Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int DeleteOdds( Node **a ) {
- if ( empty( *a ) ) return 0;
- while ( *a != NULL && (*a)->data % 2 == 1 ) *a = (*a)->next;
- Node *x = *a; Node *p;
- while ( x != NULL ) {
- bool flag = false;
- while ( x != NULL && x->data % 2 == 1 ) {
- Node *tmp = x;
- p->next = x->next;
- x = x->next;
- free( tmp );
- flag = true;
- }
- if ( x != NULL ) {
- p = x;
- x = x->next;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement