{ "q1": { "type": "blank", "question": "\n

\n\nHow many subsets of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} are divisible\nby 3 (that is the sum of the all the elements in the subset is\ndivisble by 3?\n\n

\n\n

Write a program that computes this and enter in the number\nbelow.

\n\n

____

\n\n

Note: As shown in the book, order does not matter when defining a\nsubset. Therefore, {0, 1, 2} and {1, 0, 2} counts as one\nset.

\n" }, "q3": { "type": "blank", "question": "\n\n\nComplete the Python code below so that the program prints all permutations\nof \"ABC\": ABC, ACB, BAC, BCA, CAB, CBA.\n\n\n\n
\nimport ____\n\ns = \"ABC\"\nfor p in ____(s):\n    print(''.____(p))\n\n
\n" }, "q2": { "type": "blank", "question": "\n\n\nComplete the C++ code below so that the program prints all permutations of\n\"ABC\": ABC, ACB, BAC, BCA, CAB, CBA.\n\n\n\n
\nint main(int argc, char *argv[]) {\n    string s = \"ABC\";\n    ____(s.begin(), s.end());\n    do {\n        cout << s << endl;\n    } while (____(s.begin(), s.end()))\n\n    return 0;\n}\n
\n" }, "q4": { "type": "blank", "question": "\n\n\nA ____ algorithm starts with an empty solution and extends the solution\nstep by step by ____ searching through all the different ways a solution\ncan be constructed. Because this can be quite exhaustive, we may wish to\nadd \"intelligence\" to our search by ____ the search tree, which means\neliminating a candidate solution if we can determine that it is a dead end.\n\n\n" } }