KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
For example, if I wanted all binary strings of length 3 I could simply declare them like this: boolean[] str1 = {0,0,0}; boolean[] str2 = {0,0,1}; boolean[] str3 = {0,1,0}; boolean[] str4 = {0,1,1}; boolean[] str5 = {1,0,0}; boolean[] str6 = {1,0,1}; boolean[] str7 = {1,1,0}; boolean[] str8 = {1,1,1}; What is the most efficient way to generate all possibly binary strings of length N into a boolean array ? I don't necessarily need the most efficient method, just one that's fairly efficient and easy for me to multithread. EDIT: I should note that I will be storing them all in an ArrayList, if that matters.
Tags (comma-separated)
Save Edits
Cancel