开发者

discrete math arrays and binary relations

开发者 https://www.devze.com 2023-02-11 17:49 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消