-
Notifications
You must be signed in to change notification settings - Fork 0
Special Array Operations
Kameron Brooks edited this page Dec 26, 2018
·
3 revisions
The expression x :: y
returns true if the set x
is a subset of y
y
must be an array or list
x
can be an array, list or a single element
This operator assumes that neither set is sorted and performs an O(n) Linear search of set y for each element in x. The lists are assumed to be unsorted. If all elements in set x are found in y then the operation returns true
otherwise it is false
Here are some examples:
1 :: [0,1,2]; // true
[0,1] :: [0,1,2]; // true
[1,0] :: [0,1,2]; // true, order does not matter
3 :: [0,1]; // false
[3] :: [0,1]; // false
[0,3] :: [0,1]; // false
The expression x :: y
returns true if the set x
is not a subset of y
Questions? Comments?
Contact me at [email protected]
Follow on Twitter: @wasteland_11
Copyright 2019 © Kameron Brooks