discrete math arrays and binary relations
Given are two arrays a and b both of length M . Given also is a binary relation R. Specify for开发者_如何学JAVAmally a program to determine whether corresponding elements of a and b are all related by relation R.
Assuming that you are testing whether a[i] R b[i]
:
for i=1..M:
if not (a[i] R b[i]):
return false
return true
精彩评论