4. Question about set. There is an integer set, and it is empty at initial status. The following actions are defined. a. add

Please finish this question in C programming

Thank you so much!

4. Question about set. There is an integer set, and it is empty at initial status. The following actions are defined. a. add total number of Ns in the set. to this set as an element, and return value is put number N: b. del N: pop one number N element out from the set, and return value is total number of Ns before deletion c. ask truth or false for whether N has been in the set before, second one is how many Ns in the current set. inquire number N’s status, and return 2 values, first one is N: Inputs from keyboard: Enter the total number of commands: 7 Enter the commands as follows: add 1 add 1 ask 1 ask 2 del 2 del 1 ask 1 Output: 1 12 00 10



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *