MCQ
Paper - II (vii) — Algorithms MCQ - Practice Questions with Answers
Solve 44 Paper - II (vii) — Algorithms questions for RAS/RPSC preparation.
Practice questions
Q1For sufficiently large n, which time complexity grows faster: O(n log n) or O(n^2)?
As n becomes large, n squared grows faster than n log n because n/log n tends to increase without bound. This is why an O(n log n) sorting algorithm is usually preferred over an O(n^2) one for large inputs.
Q2For a binary tree, which traversal visits the left subtree first, then the root node, and then the right subtree?
Inorder traversal of a binary tree is defined by the sequence left subtree, root, and right subtree. This makes it especially important for binary search trees, where it lists keys in sorted order.
Q3What does Big-O notation primarily express in algorithm analysis?
Big-O notation is used to describe an upper bound on the growth of an algorithm resource such as time or memory as input size increases. It suppresses constant factors and lower-order terms for large-input comparison.
Q4Which problem is a standard example where a greedy strategy gives an optimal solution when edges are chosen by increasing weight with cycle checks?
Kruskal's algorithm is a classic greedy algorithm for the minimum spanning tree problem. It repeatedly selects the smallest edge that does not create a cycle, and this safe-choice rule leads to an optimal spanning tree.
Q5If an algorithm has running time O(n), what does this notation primarily express?
O(n) states that beyond some input size, the running time is bounded above by a constant multiple of n. It is about growth rate, not an exact step count.
You've seen 5 of 44 sample questions
Unlimited practice on Paper - II (vii) — Algorithms comes with the RAS Test Series + Practice pack or Gate Pass.
More questions
6In a binary tree, which visiting order is used by preorder traversal?
7Which pair correctly matches the asymptotic notation with its usual meaning?
8Which pair correctly matches the algorithmic strategy with a typical feature?
9Which statement best describes the role of a bound in a branch and bound method for an optimization problem?
10If a traversal visits every node of a binary tree exactly once and does constant work per node, what is its time complexity for n nodes?
11If an algorithm has time complexity O(n), how does its running time grow when the input size n is doubled, ignoring constants and lower-order terms?
12Which statement best describes a greedy algorithm?
13For a binary tree, which traversal visits the left subtree first, then the root, and then the right subtree?
14A recursive traversal visits every node of a binary tree exactly once. If the tree has n nodes, what is its time complexity?
15In a binary tree traversal, which order is followed by preorder traversal?
