Data Structures and Algorithms (BSc CSIT, CSC206): the questions likely to come
20 analyzed questions from 7 past papers (2074-2081), grouped by syllabus unit — each with its probability, how often it's been asked, and where to study the answer.
Explain merge sort with its algorithm. Sort the list 38, 27, 43, 3, 9, 82, 10 using merge sort showing all the intermediate steps and analyze its complexity.
Merge Sort
Merge sort is a divide-and-conquer sorting algorithm. It recursively divides the list into two halves, sorts each half, and then merges the two sorted halves into a single sorted list.
Algorithm
MERGE-SORT(A, low, high)
if low < high
mid = (low + high) / 2
MERGE-SORT(A, low, mid) // sort left half
MERGE-SORT(A, mid+1, high) // sort right half
MERGE(A, low, mid, high) // merge the two halves
MERGE(A, low, mid, high)
copy A[low..mid] into L and A[mid+1..high] into R
i = 0, j = 0, k = low
while i < |L| and j < |R|
if L[i] <= R[j]: A[k++] = L[i++]
else: A[k++] = R[j++]
copy any remaining elements of L and R into A
Sorting 38, 27, 43, 3, 9, 82, 10
Divide (split until single elements):
[38, 27, 43, 3, 9, 82, 10]
[38, 27, 43, 3] [9, 82, 10]
[38, 27] [43, 3] [9, 82] [10]
[38] [27] [43] [3] [9] [82] [10]
Conquer (merge back, sorted):
[38] + [27] -> [27, 38]
[43] + [3] -> [3, 43]
[27,38] + [3,43] -> [3, 27, 38, 43]
[9] + [82] -> [9, 82]
[9,82] + [10] -> [9, 10, 82]
[3,27,38,43] + [9,10,82] -> [3, 9, 10, 27, 38, 43, 82]
Sorted output:
Complexity Analysis
The recurrence is:
By the Master Theorem (, so ):
| Case | Time |
|---|---|
| Best | |
| Average | |
| Worst |
Space complexity: for the auxiliary arrays. Merge sort is stable but not in-place.
Sorting
Explain merge sort with its algorithm. Sort the list 38, 27, 43, 3, 9, 82, 10 using merge sort showing all the intermediate steps and analyze its complexity.
What is sorting? Explain the working mechanism of quick sort algorithm with a suitable example. Analyze its best-case and worst-case time complexity.
Explain heap sort algorithm with an example and analyze its time complexity.
Differentiate between bubble sort and selection sort with examples.
Sit a probable paper
A full mock exam built from the most likely questions, mirroring the real paper's structure. Every slot is a real past question.
Most Probable Paper
Mirrors the real structure · 60 marks · based on 7 past papers
- 1.[10 marks]
Explain merge sort with its algorithm. Sort the list 38, 27, 43, 3, 9, 82, 10 using merge sort showing all the intermediate steps and analyze its complexity.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Sorting) appears in 100% of years.
- 2.[10 marks]
What is a graph? Explain Breadth First Search (BFS) and Depth First Search (DFS) traversal techniques with suitable examples and their applications.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Graphs) appears in 100% of years.
- 3.[10 marks]
What is sorting? Explain the working mechanism of quick sort algorithm with a suitable example. Analyze its best-case and worst-case time complexity.
This question has recurred in 3 of 7 years; so far only in internal assessments, not the board; and its topic (Sorting) appears in 100% of years.
- 1.[5 marks]
Explain different representations of a graph (adjacency matrix and adjacency list) with examples.
This question has recurred in 6 of 7 years; so far only in internal assessments, not the board; and its topic (Graphs) appears in 100% of years.
- 2.[5 marks]
What is a heap? Explain the heapify operation and construct a max-heap from 4, 10, 3, 5, 1.
This question has recurred in 6 of 7 years; so far only in internal assessments, not the board; and its topic (Trees) appears in 100% of years.
- 3.[5 marks]
Compare linear search and binary search. Write an algorithm for binary search and analyze its complexity.
This question has recurred in 6 of 7 years; so far only in internal assessments, not the board; and its topic (Searching) appears in 100% of years.
- 4.[5 marks]
Explain heap sort algorithm with an example and analyze its time complexity.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (Sorting) appears in 100% of years.
- 5.[5 marks]
Differentiate between bubble sort and selection sort with examples.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (Sorting) appears in 100% of years.
- 6.[5 marks]
What are the applications of stack? Explain how a stack is used in function calls.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (The Stack and Queue) appears in 100% of years.
- 7.[5 marks]
Define a queue. Explain circular queue and write an algorithm for its enqueue and dequeue operations.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (The Stack and Queue) appears in 100% of years.
- 8.[5 marks]
What is recursion? Write a recursive algorithm to compute the factorial of a number and explain the role of the stack in recursion.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (The Stack and Queue) appears in 100% of years.
- 9.[5 marks]
Explain inorder, preorder and postorder tree traversals with an example binary tree.
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (Trees) appears in 100% of years.
Behind the numbers
The raw evidence the predictions are computed from: marks per unit per year, syllabus weights, trends, and coverage.
Show the heatmap, topic table and coverage analysis
The receipt: marks per unit, per year
Each row is a syllabus unit, each column an exam year, each cell the marks that unit earned that year. Click any cell to see the actual questions behind it.
| # | Syllabus unit | Probability | Appeared | Avg marks | Syllabus weight | Exam vs syllabus | Trend | Questions |
|---|---|---|---|---|---|---|---|---|
| 1 | U5Sorting | Very likely100% | 17.1 | 13%6 lecture hrs | Over-examinedexam 23% · syllabus 13% | Steady | 4 recurring4 total | |
| 2 | U7Graphs | Very likely100% | 14.3 | 13%6 lecture hrs | Over-examinedexam 19% · syllabus 13% | Steady | 3 recurring3 total | |
| 3 | U2The Stack and Queue | Very likely100% | 13.6 | 18%8 lecture hrs | Balancedexam 18% · syllabus 18% | Steady | 4 recurring4 total | |
| 4 | U4Trees | Very likely100% | 13.6 | 20%9 lecture hrs | Balancedexam 18% · syllabus 20% | Steady | 4 recurring4 total | |
| 5 | U1Concept of Data Structure | Very likely100% | 7.1 | 9%4 lecture hrs | Balancedexam 10% · syllabus 9% | Steady | 2 recurring2 total | |
| 6 | U6Searching | Very likely100% | 5.7 | 9%4 lecture hrs | Balancedexam 8% · syllabus 9% | Steady | 1 recurring2 total | |
| 7 | U3The List | Likely71% | 5 | 18%8 lecture hrs | Under-examinedexam 5% · syllabus 18% | Steady | 1 recurring1 total |
Study smart, not hard
Drag the slider: studying the top 5 units in priority order covers ~88% of all observed marks.
- ~80% line
Lecture time vs exam marks
Where the exam pays more than the curriculum spends: ● lectures vs ● exam marks, as a share of the whole course. A long teal-leading bar = high-yield unit.