Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ set swap

Input  : set1 = {1, 2, 3, 4}
         set2 = {5, 6, 7, 8}
         set1.swap(set2);
Output : set1 = {5, 6, 7, 8}
         set2 = {1, 2, 3, 4}

Input  : set1 = {'a', 'b', 'c', 'd'}
         set2 = {'w', 'x', 'y', 'z'}
         set1.swap(set2);
Output : set1 = {'w', 'x', 'y', 'z'}
         set2 = {'a', 'b', 'c', 'd'}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #set #swap
ADD COMMENT
Topic
Name
4+4 =