Algorithms MCQs with Answers
Data PracticeRecurrences, shortest paths and paradigms.
Data / Algorithms
Recurrence Relations & Asymptotics MCQs
50 QuestionsPractice MCQs on Master Theorem, recursion tree method, substitution method, and time complexity calculations.
2The minimum number of moves needed to solve the Tower of Hanoi with 5 disks is:
3The naive string-matching algorithm has worst-case time:
4The worst-case time of the Rabin–Karp algorithm is:
5For the pattern ababaca, what is the length of the longest proper prefix that is also a suffix of the whole pattern?
6The Knuth–Morris–Pratt algorithm matches a pattern of length m in a text of length n in:
7Primality testing (the AKS algorithm) shows that PRIMES is in:
8The tautology problem (TAUT) for Boolean formulas is:
9Which problem is in NP but is not known to be in P or NP-complete?
10The standard maximal-matching algorithm for Vertex Cover gives an approximation ratio of:
11The halting problem is:
12To prove that problem B is NP-complete, you should show B ∈ NP and reduce:
13I. Every problem in P is in NP. II. Every NP-hard problem is in NP.
14Which of these problems is solvable in polynomial time?
15If any single NP-complete problem is solvable in polynomial time, then:
16Which of the following is NP-complete?
17A red–black tree with n internal nodes has height at most:
18In a B-tree of minimum degree t, the maximum number of keys in a node is:
19Linear probing mainly suffers from:
20In open addressing with load factor α < 1 and uniform hashing, the expected number of probes in an unsuccessful search is at most:
21How many structurally different BSTs exist with 4 distinct keys?
22The height of a BST built by inserting n keys in sorted order is:
23The minimum number of nodes in an AVL tree of height 4 (a single node has height 0) is:
24Inserting a key into an AVL tree requires at most how many rotations to restore balance?
25Union by rank with path compression gives an amortized cost per disjoint-set operation of:
26Johnson's all-pairs shortest path algorithm on a sparse graph runs in:
27Single-source shortest paths in a weighted DAG can be found in:
28What is the minimum number of edges in a strongly connected directed graph with n ≥ 2 vertices?
29For a dense graph with E ≈ V², the simplest asymptotically good MST algorithm is:
30In Floyd–Warshall, a negative cycle exists iff:
31Whether an undirected graph is bipartite can be tested in:
32What is the maximum flow from s to t in this network? Capacities: s→a 10, s→b 5, a→b 15, a→t 5, b→t 10.
33The Edmonds–Karp algorithm for maximum flow runs in:
34How many labelled spanning trees does the complete graph K₄ have?
35I. Dijkstra's algorithm is correct for graphs with negative edges if there is no negative cycle. II. Bellman–Ford can detect a negative cycle reachable from the source.
36Articulation points of an undirected graph can be found in:
37Tarjan's and Kosaraju's algorithms find:
38A topological ordering of a directed graph exists if and only if the graph is:
39A directed graph contains a cycle if and only if a DFS produces:
40BFS on a graph stored as adjacency lists takes:
41If only the length of the LCS of strings of lengths m and n is needed, the space can be reduced to:
42The Held–Karp DP algorithm for TSP runs in:
43What is the minimum number of coins to make 11 from {1, 5, 6, 9}?
44How many ways can amount 5 be made from coins {1, 2, 5} (order does not matter)?
45The length of the longest palindromic subsequence of BBABCBCAB is:
46The Bellman–Ford algorithm runs in:
47The Floyd–Warshall algorithm runs in:
48Which of these algorithms does NOT exhibit overlapping subproblems?
49For matrix-chain multiplication of n matrices, the DP table and time are:
50The DP solution to 0/1 knapsack with n items and capacity W runs in:
Comprehensive Question Hub
Subject-Wise MCQ Practice
Select any core Computer Science or programming subject below to access dedicated practice questions, answers, and topic-wise modules.
Practice Computer Science MCQs27 Core Subjects
Fundamental CS engineering subjects covering systems, theory, and data architecture.
Programming Language MCQs9 Languages
Practice coding output questions, language syntax, OOP paradigms, and standard libraries.
MCQs for Competitive Exams
Prepare with exam-specific question banks tailored to syllabi, previous years' question papers, and negative-marking criteria.
BPSC TRE 2.0 Computer Science
Practice BPSC TRE 2.0 Class 11-12 Computer Science previous-year questions with solutions.
BPSC TRE 3.0 Computer Science
Practice BPSC TRE 3.0 Class 11-12 Computer Science previous-year questions with solutions.
BPSC TRE 4.0 Computer Science
Practice BPSC TRE 4.0 Class 11-12 Computer Science previous-year questions with solutions.
Bihar STET Paper II Computer Science
Practice Bihar STET Paper II Class 11-12 Computer Science questions with solutions.
GATE Computer Science (CSE)
High-yield engineering questions covering Algorithms, Theory of Computation, Compiler Design, Computer Organization, and Operating Systems.
UGC NET Computer Science
Comprehensive question sets aligned with NTA UGC NET Paper II syllabus, featuring theoretical foundations, discrete math, and systems.
SSC & State Technical Exams
Foundational and practical MCQs for technical assistants, programmers, and informatics officers in central and state departments.
Why Practice MCQs on CodeZov?
A modern, high-yield practice platform designed to build speed, accuracy, and deep conceptual clarity.
Instant Answers & In-Depth Explanations
Receive immediate validation with step-by-step technical explanations and code breakdown so you learn from mistakes on the spot.
Full-Screen Distraction-Free Exam Mode
Simulate authentic exam environments with dedicated Full-Screen mode, keyboard shortcuts (1-4, A-D, Enter), and a live question matrix.
Topic-Wise & Subject-Wise Syllabus
Explore modular practice sets across Data Structures, Algorithms, DBMS, Operating Systems, Computer Networks, and modern programming languages.
Previous Year Questions (PYQs)
Solve authentic previous year questions adapted from BPSC TRE Computer Science, GATE CSE, and UGC NET question papers.
Ready to Deepen Your Conceptual Knowledge?
MCQ practice is most effective when paired with structured conceptual tutorials, career roadmaps, and full-length timed mock tests. Check out CodeZov's free resources to boost your preparation.
Core Syllabus Coverage
- Programming (C, C++, Java, Python, SQL)
- Data Structures & Algorithms
- Database Management Systems (DBMS)
- Operating Systems & Architecture
- Computer Networks & Cybersecurity
Frequently Asked Questions
Answers to common questions about practicing Computer Science MCQs on CodeZov.
What are MCQs?
Multiple-Choice Questions (MCQs) are objective assessment questions where learners select the correct option from multiple choices. In Computer Science, MCQs evaluate theoretical understanding, code snippet outputs, algorithm time complexities, and system architecture fundamentals.
Can I practice Computer Science MCQs online?
Yes, CodeZov offers 100% free online Computer Science MCQ practice with instant scoring, step-by-step explanations, code execution analysis, and Hindi translations without requiring mandatory registration or fees.
Are MCQs available topic-wise?
Yes, all questions on CodeZov are systematically organized by subject (such as DBMS, Operating Systems, Data Structures) and further categorized into specific topics (such as Trees, Normalization, CPU Scheduling, and TCP/IP) for focused preparation.
Do MCQs include answers and explanations?
Every MCQ on CodeZov features verified correct answers alongside in-depth conceptual explanations. Many questions also include bilingual Hindi explanations and line-by-line code breakdowns to ensure complete conceptual clarity.
Which subjects are available for MCQ practice?
CodeZov provides MCQs across over 40 technical subjects including C Programming, C++, Java, Python, Data Structures, Algorithms, DBMS, Operating Systems, Computer Networks, Theory of Computation, Compiler Design, Digital Logic Design, and Software Engineering.
Can I use MCQs to prepare for competitive exams?
Yes, our question bank is specifically curated for competitive examinations including BPSC TRE Computer Science (Class 11-12), GATE CSE, NTA UGC NET / JRF, ISRO, NIELIT, Kendriya Vidyalaya (KVS/NVS) PGT Computer Science, and university semester exams.