combinations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fitsumtk
    New Member
    • Mar 2007
    • 3

    combinations

    Does any one have a code for picking combinations of elements from different sets? For e.g.: If A={(1, 2), (3,4,5)}, I need a function that returns {(1, 3), (1, 4), (1, 5),(2, 3), (2, 4), (2, 5)}

    Thanks
    fitsumtk
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by fitsumtk
    Does any one have a code for picking combinations of elements from different sets? For e.g.: If A={(1, 2), (3,4,5)}, I need a function that returns {(1, 3), (1, 4), (1, 5),(2, 3), (2, 4), (2, 5)}

    Thanks
    fitsumtk
    I think its thy assignment so just think logic for it develope some code and then ask if u got any problem
    The sol to this problem is 2 for loops
    try it
    Good Luck

    Comment

    Working...