I’ve been reading this site long enough to know not to hide that this is a homework assignment. But I am trying to write a code that can generate all possible combinations of a string of only 0’s and 1’s. If the length of the string is n^2, then there will be n 1’s and the rest will be 0’s. The length is always a perfect square. I am coding in C and I have been trying to do it in nested loops but it seems like it could be done more easily in a recursive manner, I’m just not sure how to get that set up. Any tips or advice would be greatly appreciated.
Share
pseudocode: