| Author |
Comment/Response |
yehuda ben-shimol
|
09/19/06 11:22pm
If you do not mind that the order of the elements in the list is not maintained, this is rather easy
rotEq returns True if the two lists are rotational equivalent, and then this can be used for the SameTest option of Sort
rotEq[l1_List, l2_List] /; Length[l1] == Length[l2] :=MemberQ[NestList[RotateLeft, l2, Length[l2] - 1], l1]
Sort[yourlist, SameTest->rotEq]
good luck
by the way, the definition of ListA in your post is erroneous
regards
yehuda
URL: , |
|