GATE 2015 Algorithm Questions: 13 PYQs Across 5 Topic Families
See how 13 GATE 2015 Algorithm PYQs divide across five topic families, then work the recurrences, MST constraints, runtime scaling and asymptotic traps.
KnowledgeGate Team
Exam prep & CS education

A year-wise answer list hides the solving moves that GATE 2015 combined. The 13 PYQs span five topic families and three paper sets, with one question lacking a set label. Use the official archive for the original paper wording. Compare this sorting-heavy, 13-question set with Sorting Algorithms: Complexity and Comparison, where five different PYQs include two Marks to All outcomes.
GATE 2015 Algorithm questions: the 13-question map
Question reference | Set | Type | Topic and subtopic | Tested move | Answer |
|---|---|---|---|---|---|
Set 1 | MCQ | Minimum Spanning Trees, Prim | match four algorithms to four design paradigms | P-ii, Q-iii, R-iv, S-i | |
Set 1 | MCQ | Sorting, Quick Sort | model the worst partition recurrence | T(n)=T(n-1)+T(1)+cn | |
Set 1 | MCQ | Sorting, Comparisons and Searching | compare total costs for an operation mix | unsorted array | |
Set 1 | NAT | Minimum Spanning Trees, Prim | assign the least legal non-tree edge weights | 69 | |
Set 1 | MCQ | Time Complexity, Iterative Loops | count a log-inside-log loop | Theta(n log log n) | |
Set 2 | MCQ | Sorting, Comparisons and Searching | find one element that is neither extreme | Theta(1) | |
Set 2 | MCQ | Dynamic Programming, Advanced Mix | match Dijkstra, Floyd-Warshall, binary search, and backtracking to paradigms | greedy, DP, divide and conquer, DFS | |
Set 2 | MCQ | Sorting, Quick Sort | reconstruct Quickselect's two recursive argument lists | option 1 | |
Set 3 | MCQ | Algorithm Analysis, Growth Rates | classify the sum of cubes | I, III, and IV, but not II | |
Set 3 | MCQ | Sorting, Merge Sort | scale n log n runtime from 30 seconds to 6 minutes | 512 | |
Set 3 | NAT | Minimum Spanning Trees, Prim | update an MST after adding a constant to every edge | 995 | |
Set 3 | MCQ | Algorithm Analysis, Growth Rates | compare n with an oscillating exponent | neither I nor II | |
no set label | MCQ | Algorithm Analysis, Growth Rates | order sublinear, linear, quadratic, and exponential functions | f1 < f2 < f4 < f3 |
In these 13 questions, Sorting contributes 5, MST 3, Algorithm Analysis 3, Dynamic Programming 1, and Time Complexity Analysis 1. The formats total 11 MCQ + 2 NAT; the paper-set labels total 5 + 3 + 4, with one unlabelled question. Treat these as practice categories, not official subject weightage. Use the GATE previous-year question-paper archive for the original papers.
GATE 2015 Sorting questions: recurrence, operation mix, and constant work
In 3313's worst case, the pivot leaves sizes n-1 and 0: T(n)=T(n-1)+T(1)+cn. For n=5, partition work is 5c+4c+3c+2c=14c, plus base constants. The series gives Theta(n^2); 2T(n/2)+cn would describe a balanced split.
For 3359, an unsorted array makes N inserts Theta(N). With direct positions, deletes or decrease-key operations stay constant, while sqrt(log N) linear finds total Theta(N sqrt(log N)). A min-heap already spends Theta(N log N) on inserts, so the unsorted array wins the aggregate workload.
For 3380, take any three distinct elements and return their median. One chosen value is smaller and one larger, so it cannot be a global extreme. Constant comparisons give Theta(1).
GATE 2015 Quickselect and Merge Sort: track the subproblem precisely
For 3413, if left_end+1 > k, recurse on (a, left_end, k). Otherwise use (a+left_end+1, n-left_end-1, k-left_end-1). The second call moves past the pivot, shrinks the array, and converts k to the right subarray's local rank.
Merge Sort scales as n log2 n. At n=64, 64 x 6=384 units take 30 seconds. Six minutes is 12 times longer, so the target is 12 x 384=4608. Since 512 x 9=4608, the answer is 512. Scale n log n, not n alone. See Sorting Algorithms: Complexity and Comparison for the broader comparison.
GATE 2015 MST questions: path constraints and a constant edge shift

For 3362, MST edges AC=9, BC=2, BE=15, EF=4, and DF=6 total 36. The path maxima for AB, ED, and CD are 9, 6, and 15, so their least distinct legal integers are 10, 7, and 16. Therefore 36+10+7+16=69. A lower value would replace an edge on the stated tree path.
For 3484, a tree on 100 vertices has 99 edges. Adding 5 to every graph edge adds 99 x 5=495 to every spanning tree, so their ordering is unchanged. The new MST weight is 500+495=995; the graph's 300-edge count is irrelevant.
For the paradigm matches, Prim and Dijkstra are greedy, Floyd-Warshall is DP, Merge Sort and binary search are divide and conquer, and Hamiltonian backtracking follows DFS.

GATE 2015 Algorithm Analysis: nested logs, sums, and oscillation
With n=256, the outer loop runs 255 times. Halving visits 256,128,64,32,16,8,4,2, so p=8; k=1,2,4 then gives three increments. Thus q=255 x 3=765. Generally the factors are Theta(n) and Theta(log log n), producing Theta(n log log n).
Also, sum(i^3)=[n(n+1)/2]^2=Theta(n^4). Therefore I, III (O(n^5)), and IV (Omega(n^3)) hold, but II (Theta(n^5)) does not. Big-O and Omega permit loose bounds; Theta must be tight.
For f(n)=n and g(n)=n^(1+sin n), integer subsequences place sin n above 1/2 and below -1/2 infinitely often. Along the first, f/g=n^(-sin n) tends to 0; along the second, it grows without bound. Therefore neither f=O(g) nor f=Omega(g) holds.
GATE 2015 Algorithm difficulty read: reasoning load, not an official label
No difficulty rating was provided for any of the 13 questions, so these are editorial reasoning bands rather than official labels.
Reasoning band | Records |
|---|---|
Recognition with a decisive fact | two paradigm matches; median of three |
Model or trace | Quick Sort, operation mix, Quickselect, nested logs, cubes, function ordering |
Multi-step construction or proof | 69 edge assignment, scaling to 512, 995 shift, oscillating exponent |
Trap | What goes wrong | Repair |
|---|---|---|
central or first pivot sounds balanced | writes 2T(n/2) | inspect partition sizes |
many operations mention a heap | optimises one operation | multiply counts by costs |
add 5 to 300 graph edges | gets 2,000 | count 99 tree edges |
three nested loops | writes n log n or n(log n)^2 | recognise log p=log log n |
one observed subsequence | asserts O or Omega | test both extremes |
The recurring move is selecting the model before calculating. This historical split does not predict later papers.
GATE 2015 Algorithm revision: four blank-sheet checks
Worst-case Quick Sort: expand T(n)=T(n-1)+T(1)+cn to 14c at n=5.
MST path constraints: derive non-tree weights 10, 7, and 16, then total 69.
Merge Sort scaling: convert 30 seconds to 360 and solve n log2 n=4608 to get 512.
Nested-loop trace: count p=8 and three inner steps across 255 outer iterations to reach 765.
For any miss, write the modelling decision before repeating the calculation: partition sizes, maximum-on-path constraint, runtime scale factor, or loop-bound transformation.
Need | Best next page | Why |
|---|---|---|
choose the relevant GATE route | see the wider preparation path | |
rebuild Algorithm concepts in syllabus sequence | repair concept gaps systematically | |
apply known concepts in topic-wise and mock practice | practise selection under time pressure |
The practice bank currently offers over 1,200 Algorithm questions for broader practice; only 13 belong to this GATE 2015 set.
The short version
These 13 questions reward model selection before calculation. Name the recurrence, aggregate cost, path maximum, invariant, or asymptotic relation first, then test the result against the stem's exact operation. A memorised answer will not transfer if the model is wrong.
Keep learning
GATE 2012 Algorithm Questions: Topic Map and Worked PYQs
Turn the five currently tagged GATE 2012 Algorithm items into a revision plan, with worked concepts and the official Code A outcomes kept separate.
GATE 2015 C Programming Questions: Topic Map and Worked Traces
Knowing a C rule is only the start. Trace pointer updates, recursion and persistent state in GATE 2015 questions, then use the topic map to plan revision.
GATE 2014 C Programming Questions: Topic Analysis and Worked Traces
Trace seven selected GATE 2014 C questions to understand pointer input, double swaps, search boundaries and integer arithmetic. Use the mistakes to guide a focused revision session.
GATE 2012 C Programming Questions: Switch and Storage-Class Analysis
Knowing C syntax is not enough when execution falls through a switch or a local variable survives a call. Trace three GATE CS 2012 C questions and compare the storage rules behind their outputs.





