阅读背景:

查找是否存在整数数组子集的高效算法,其所有元素的xor是否为给定值?

来源:互联网 

I have a positive integer array- {1,5,8,2,10} and a given value 7. I need to find whether a subset of the array exists such that the XOR of its elements is the value 7. In this case the subset is {5,2} because 5 xor 2 is 7. One naive solution is to find all the subsets and check whether a solution exist.I want some algorithm better than the naive. NOTE:-I just need to find whether a solution exists or not.I don't need to find the subset.I have a positive integer array- {1,5,8,2,10} a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: