Open In App

Checking the equality of sets in Julia – issetequal() Method

The issetequal() is an inbuilt function in julia which is used to determine whether the two specified sets a and b have the same elements or not.
 

Syntax:



 issetequal(a, b)

Parameters: 

Returns: It returns true if the two sets are equal else returns false. 
 
Example 1: 






# Julia program to illustrate
# the use of issetequal() method
  
# Getting true if the two sets
# are equal else returns false.
println(issetequal([1, 2], [1, 2, 3]))
println(issetequal([1, 2], [3, 1, 2]))
println(issetequal([2, 2], [1, 2, 2]))

Output: 
 

Example 2: 
 




# Julia program to illustrate
# the use of issetequal() method
  
# Getting true if the two sets
# are equal else returns false.
println(issetequal([1, 2], [1, 2]))
println(issetequal([1, 2], [2, 1]))
println(issetequal([2, 2, 3], [2, 3, 2]))
println(issetequal([1, 2, 3], [3, 1, 2]))

Output: 
 

 


Article Tags :