• Google

    Populate a 2D Vector with all the K- sized subsets of an initial vector /Link




    I'm trying to create the subsets of a set with the help of vectors(basically lists). Initially the list is populated with the required elements by push_back( ). I took the recursive approach for creating all the K-sized subsets. This is my code.

    K-Sized Subsets.

    But, I'm not able to print the subsets via iterating the list with list<int>::iterator.

    I don't get any result except "\n"s getting printed a bunch of times.

    https://i.redd.it/7sexrewhhbs11.png

    Do you notice anything that I missed in the code?

    Thank you.

    submitted by /u/iammunukutla
    [link] [comments]



    (@)/u/iammunukutla

    Published on 15 Oct 2018 at 09:20AM



















  • Recent Posts








    ^Comments