+ 2
What is the program for addition of two sets using c language?
Please. Im not able to make code for addition of two sets
3 Réponses
+ 1
I want to add two sets of integer
0
Hi Dnyaneshwari,
The code will depend on which is the type of your set elements. For example, if they are integer you can even think in doing addition using bitsets, if they are strings you will need to do more comparisons, and if they are floating point you will need to be careful with rounding errors.
I can help with the code when you provide more details.
0
Hi Dnyaneshwari,
Here is a code for integers. Notice that by definition sets do not have repeated elements.
The space requirements is O(M+N), and time complexity is O(KlogK), where K = max(M,N), M is the size of set A and N is size of set B.
https://code.sololearn.com/cNOJalbo9UBV/?ref=app