Which one of the following options lists the functions in increasing order of asymptotic growth rate?
Note: Assume the base of log to be 2.
GATE CS Algorithms: 1 units and 5 chapters, weightage from 47 previous year questions across 10 papers, a study order by exam weight and 10 practice questions
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
GATE CS Algorithms: 1 units and 5 chapters, weightage from 47 previous year questions across 10 papers, a study order by exam weight and 10 practice questions.
47 previous year questions from Algorithms in GATE CS, grouped by chapter with the exam year, answer key and step-by-step solution for each.
We counted every GATE CS Algorithms previous year question in our bank (47 questions from 10 papers) and grouped them by unit.
| Unit | Chapters | PYQs | Share of section | Avg per paper |
|---|---|---|---|---|
| Algorithms | 5 | 47 | 100% | 4.7 |
Start where the marks are. Units at the top of this list have appeared most often in past GATE CS papers.
3
Key idea: This is a merge sort operation counting question, recognisable because it asks for the number of "void" merge operations on a specific array. A void merge occurs when the left subarray's maximum element is less than or equal to the right subarray's minimum element.
Step 1: Trace the merge sort tree for .
Step 2: Level 3 (size 1 to 2):
Step 3: Level 2 (size 2 to 4):
Step 4: Level 1 (size 4 to 8):
Step 5: Total void merges = 3.
Answer: 3
unmark all for each if is unmarked end if end for | mark for each if is unmarked end if end for return |
["B","D"]
Key idea: This is a "DFS timestamp and DAG properties" question, recognisable because it asks which timestamp relationships are impossible for an edge in a Directed Acyclic Graph.
Step 1: Understand the Parenthesis Theorem.
For any two vertices and in a DFS traversal, their discovery/finish intervals and must be either completely disjoint or perfectly nested. They can never partially overlap.
Step 2: Evaluate Option D.
represents partially overlapping intervals. This violates the Parenthesis Theorem and is impossible in ANY DFS traversal, regardless of whether the graph is a DAG. Thus, Option D will NEVER be correct.
Step 3: Evaluate Option B.
represents perfectly nested intervals where is an ancestor of . This means the edge goes from a descendant to an ancestor, which is the definition of a back edge. A back edge implies the existence of a cycle. Since the input graph is a DAG (Directed Acyclic Graph), it cannot contain any cycles, and therefore cannot contain any back edges. Thus, Option B will NEVER be correct.
Step 4: Evaluate Options A and C.
Option A () represents nested intervals where is an ancestor of . This corresponds to a tree edge or forward edge, which are perfectly valid in a DAG.
Option C () represents disjoint intervals where is completely finished before is discovered. This corresponds to a cross edge, which is also valid in a DAG.
Answer: B, D
Let be a weighted directed acyclic graph with edges and vertices. Given and a source vertex in , which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from to all vertices that are reachable from in ?
A
Key idea: Shortest paths in a Directed Acyclic Graph (DAG) can be found in linear time using topological sorting.
Step 1: Recognize that the graph is a DAG. This is the crucial condition that allows a faster algorithm than Dijkstra's or Bellman-Ford.
Step 2: Perform a topological sort of the vertices. This takes time using DFS or Kahn's algorithm.
Step 3: Initialize the distance to the source vertex as 0, and all other vertices as .
Step 4: Process each vertex in topological order. For each outgoing edge with weight , relax the edge: if , update .
Step 5: Since each vertex and each edge is processed exactly once in the topological order, the relaxation step takes time.
Answer: