Permutation algorithms in C#

前端 未结 4 1257
我在风中等你
我在风中等你 2021-01-13 13:02

I\'m struggling with this algorithm I need to write. I\'m using C#.

Say I have a List and I have a List. I need to

4条回答
  •  盖世英雄少女心
    2021-01-13 13:31

    Use a cross join in LINQ:

    var qry = from bag in bags
              from lunch in lunches
              select new BagLunch 
              { Bag=bag, Lunch=lunch};
    var baglunches = qry.ToList();
    

    Edit:
    You'll want to modify the select clause to handle the structure of your BagLunch class.

提交回复
热议问题