I im trying to implement a stack-based postfix calculator for sets of nonnegative

integers. The input consists of the following items:

a. n, the number of input sets, on a line by itself.

b. n ordered sets of non-negative integers, each starting on a new line and each terminated by -1. Each set is to be stored as an ordered, singly-linked,circular list with a header.

c. A string containing a postfix expression, on a line by itself, without any spaces. The following

may appear:

U set union (destructive, i.e. the result set will be created using some elements of the operand

sets. Extra elements must be recycled.)

I set intersection (destructive)

- set difference (destructive)

\ symmetric difference (destructive)

= equality test (destructive)

< tests whether the first operand set is properly contained in the second operand set (destructive)

& Boolean and (implementation of TRUE/FALSE is your decision)

| Boolean or

! Boolean not

x where x is a lower-case symbol in the range ‘a’ . . . ‘z’ to indicate that a copy should be made

of an input set. This copy will be an ordered singly-linked circular list with a header. A

pointer to the header of the cloned list is to be pushed to the stack. ‘a’ indicates that the first

input set should be copied, ‘b’ indicates that the second input set should be copied, and so on.

The input will be provided to your program through standard input using a shell redirect.

2. The output is the one item that remains on the stack after processing the entire postfix expression. It

may be a set (e.g. a linked list) or a Boolean value. If it is a set, then print the values separated by

spaces. If it is a Boolean value, then print TRUE or FALSE.

one example input file is

6

1 3 5 7 9 11 13 15 17 19 -1

2 4 6 8 10 12 14 16 18 20 -1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -1

0 3 6 9 12 15 18 -1

1 4 7 10 13 16 19 -1

2 5 8 11 14 17 20 -1

abcdefUUUUIabIacIadIaeIafIUUUU=

what I have done is just the link list my program

thanks for helping me