{ "q1": { "type": "multiple", "question": "\n\nWhich programming languages are normally supported in programming contest\nenvironments?\n\n", "responses": { "c": "C", "java": "Java", "python": "Python", "perl": "Perl", "cpp": "C++", "js": "JavaScript", "ruby": "Ruby", "bash": "Bash" } }, "q3": { "type": "single", "question": "\n\nWhat is the time complexity of the following code?\n\n\n
\nvoid f(vector<string> &a, vector<string> &b, vector<string> &c) {\n    c.clear();\n\n    for (auto e : a) {\n        if (find(b.begin(), b.end(), e) != b.end()) {\n            c.push_back(e);\n        }\n    }\n}\n
\n", "responses": { "1": "O(1)", "n2": "O(n^2)", "nlogn": "O(nlog(n))", "n": "O(n)" } }, "q2": { "type": "order", "question": "\n\nRank the following complexity classes from lowest (fastest) to highest\n(slowest).\n\n", "responses": { "1": "O(1)", "sqrtn": "O(sqrt(n))", "logn": "O(log(n))", "n2": "O(n^2)", "nlogn": "O(nlog(n))", "nf": "O(n!)", "n": "O(n)" } }, "q4": { "type": "single", "question": "\n\nWhat is the time complexity of the following code?\n\n\n
\nvoid f(vector<string> &a, vector<string> &b, vector<string> &c) {\n    c.clear();\n\n    sort(b.begin(), b.end());\n\n    for (auto e : a) {\n        if (binary_search(b.begin(), b.end(), e)) {\n            c.push_back(e);\n        }\n    }\n}\n
\n", "responses": { "1": "O(1)", "n2": "O(n^2)", "nlogn": "O(nlog(n))", "n": "O(n)" } } }