struct node { int num; struct node next; }; struct node head; struct node tail; fun add (int num) void { struct node newList; newList = new node; newList.num = num; newList.next = null; if(head == null) { head = newList; tail = newList; } else { tail.next = newList; tail = newList; } } fun printList (struct node cur) void { if (cur == tail) { print cur.num endl; } else { print cur.num; printList(cur.next); } } fun del (struct node cur, int num) void { struct node temp; if (cur == null) {} else {if (head.num == num) { temp = head; head = head.next; delete temp; } else {if (cur.next == tail) { temp = tail; tail = cur; tail.next = null; delete temp; } else {if (cur.next.num == num) { temp = cur.next; cur.next = cur.next.next; delete temp; } else { del (cur.next, num); } }}} } fun main () int { int x, y; int i; read x; read y; add (1); add (10); add (3); add (4); add (x); printList (head); i = 0; while( i < 50000000 ) { add(i); i = i + 1; } i = 0; while ( i < 50000000 ) { del(head,i); i = i + 1; } del (head, y); printList(head); return 0; }