CS502 MIDTERM PREPARATION.pdf
Verified academic study resource for CS502 (Fundamentals of Algorithms) under the Computer Science at Virtual University of Pakistan. This PDF document (Midterm Solved Past Paper & Revision File) covers Mid-Term Exam Scope (Lectures 1 to 22) spanning approximately 240 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS502 – Fundamentals of Algorithms
- Faculty
- Computer Science
- Format
- Type
- Midterm
- Coverage
- Mid-Term Exam Scope (Lectures 1 to 22)
- Tags
- MIDTERM
Focus on core definitions and repeated MCQs from Lectures 1–22. Remember that scoring in the First Half builds your safety buffer toward the mandatory 20% Two-Half passing rule in CS502.
What this file covers — CS502 syllabus roadmap
- Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
- Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
- Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
- Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
Frequently asked questions
Where can I download CS502 MIDTERM PREPARATION.pdf for free?
You can preview and download "CS502 MIDTERM PREPARATION.pdf" (CS502 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs502-midterm-preparation-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS502 file?
This document covers Mid-Term Exam Scope (Lectures 1 to 22) across 4 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS502 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS502 solved past papers and handouts verified for 2026 exams?
Yes. All CS502 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
CS502 MIDTERM PREPARATION
LEC WISE MCQS from lec 1 to 10
Solved by Anie
1. The term "Algorithm" is derived from:
A) Euclid
B) Turing
C) Al-Khwarizmi ✅
D) Fibonacci
2. An algorithm is:
A) A software
B) A hardware component
C) A set of programming instructions
D) A well-defined computational procedure ✅
3. What distinguishes an algorithm from a program?
A) Syntax
B) Efficiency
C) Independence from language/hardware ✅
D) Memory usage
4. Macro programming issues relate to:
A) Performance
B) Coordination of multiple programmers ✅
C) Loop optimization
D) Variable names
5. Micro issues are focused on:
A) Team management
B) High-level architecture
C) Critical code sections that consume most execution time ✅
D) Hardware design
6. Worst-case time complexity is:
A) Best possible performance
B) Maximum time taken for input size n ✅
C) Minimum time required
D) Random average
7. Which of the following is NOT a resource considered in algorithm analysis?
A) Time
B) Space
C) Battery life ✅
D) Bandwidth
8. Average-case analysis depends on:
A) Sorting
B) Probability distribution of inputs ✅
C) Execution environment
D) Code length
9. The primary mathematical model used is:
A) CPU architecture
B) RAM model ✅
C) Neural network
D) Turing machine
10. Which algorithm was used to solve 2D Maxima problem in brute force?
A) Merge sort
B) Plane sweep
C) Nested loops
D) Double for loop comparing all points ✅
11. Worst-case time for brute-force maxima algorithm is:
A) Θ(n log n)
B) Θ(n²) ✅
C) Θ(n)
D) Θ(log n)
12. What does Θ notation represent?
A) Upper bound
B) Lower bound
C) Exact growth rate ✅
D) None of the above
13. What is the sum of first n natural numbers?
A) n
B) n(n+1)/2 ✅
C) n²
D) log n
14. Which of the following is a geometric series?
A) 1 + 2 + 3 + ...
B) 1 + x + x² + ... + xⁿ ✅
C) 1 + 1/2 + 1/3 + ...
D) 1 + 2² + 3²
15. The harmonic series grows as:
A) Constant
B) Linear
C) Logarithmic ✅
D) Quadratic
16. Running time of NESTED-LOOPS example was:
A) Θ(n²)
B) Θ(n log n)
C) Θ(n³) ✅
D) Θ(n⁴)
17. Summation of i² from i=1 to n is:
A) n(n+1)/2
B) (n(n+1)(2n+1))/6 ✅
C) 2n
D) n!
18. Which function grows fastest asymptotically?
A) log n
B) n
C) n log n
D) 2ⁿ ✅
19. In asymptotic notation, O(g(n)) represents:
A) Lower bound
B) Exact value
C) Upper bound ✅
D) Average
20. Which of the following is a valid example of Θ(n²)?
A) 5n
B) 8n² + 2n - 3 ✅
C) log n
D) 2ⁿ
21. Plane-sweep algorithm improves brute-force by:
A) Recursion
B) Stack usage ✅
C) Matrix multiplication
D) Sorting edges
22. Plane-sweep first sorts the points based on:
A) y-coordinate
B) Weight
C) x-coordinate ✅
D) Value
23. Which data structure is used in plane-sweep for storing maximal points?
A) Queue
B) List
C) Tree
D) Stack ✅
24. Plane-sweep algorithm time complexity:
A) Θ(n²)
B) Θ(n log n) ✅
C) Θ(log n)
D) Θ(n³)
25. In plane-sweep, why does while-loop execute at most n times?
A) Due to nested loops
B) Every element pushed and popped at most once ✅
C) Sorting limits it
D) It breaks early
✅ Lecture 6: Asymptotic Comparisons
26. Which is the tightest bound for linear search?
A) O(n²)
B) Θ(log n)
C) Θ(n) ✅
D) Θ(1)
27. Merge sort recurrence relation is:
A) T(n) = T(n) + n
B) T(n) = 2T(n/2) + n ✅
C) T(n) = T(n-1) + log n
D) T(n) = nT(n-1) + 1
28. Asymptotic notation helps compare:
A) Algorithms of same output
B) Sorting order
C) Growth rates ✅
D) Constants
29. When using limits to compare functions, we use:
A) Derivatives
B) Recurrences
C) Limits of f(n)/g(n) ✅
D) Substitution
30. Which function is not in Θ(n²)?
A) 4n²
B) 10n²
C) n² + n
D) n³ ✅
✅ Lecture 7 to 10: Sorting and Strategy
31. Merge Sort time complexity is:
A) O(n log n) ✅
B) O(n²)
C) O(n)
D) O(log n)
32. Merge Sort is based on which strategy?
A) Brute force
B) Divide and Conquer ✅
C) Dynamic programming
D) Greedy
33. Merge Sort uses which data structure for combining?
A) Heap
B) Queue
C) Temporary array ✅
D) Linked list
34. Merge operation of merge sort takes time:
A) Θ(log n)
B) Θ(n) ✅
C) Θ(n²)
D) Θ(1)
35. Which of the following is not a divide-and-conquer algorithm?
A) Merge Sort
B) Quick Sort
C) Binary Search
D) Counting Sort ✅
✅ Lecture 10: Divide and Conquer Continued
36. Which recurrence is solved using recursion tree?
A) T(n) = nT(n-1)
B) T(n) = T(n-1) + 1
C) T(n) = 2T(n/2) + n ✅
D) T(n) = T(n/2) + 1
37. In recursion tree, cost per level is:
A) Decreasing
B) Same ✅
C) Increasing exponentially
D) Always log n
38. Total depth of recursion tree for merge sort is:
A) log n ✅
B) n
C) √n
D) n²
39. Merge Sort’s auxiliary space complexity is:
A) O(1)
B) O(n) ✅
C) O(n²)
D) O(log n)
40. Merge sort is preferred over quicksort when:
A) Space is limited
B) Array is small
C) Stability is required ✅
D) Array is sorted
✅ General Algorithm Knowledge
41. Which notation gives lower bound only?
A) O
B) Ω ✅
C) Θ
D) π
42. Which has best-case Θ(1)?
A) Binary search ✅
B) Merge sort
C) Selection sort
D) Bubble sort
43. Which one is not logarithmic?
A) log n
B) ln n
C) n log n
D) n² ✅
44. Heap sort worst-case time:
A) O(n log n) ✅
B) O(n)
C) O(n²)More CS502 files
- CS502 MIDTERM FILE 1 SOLVED BY TEAM HADI-1.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 1 SOLVED BY TEAM HADI.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 1 SOLVED BY TEAM HADI.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 1 SOLVED BY TEAM HADI.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 10 SOLVED BY TEAM HADI.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 2 SOLVED BY TEAM HADI-1.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 2 SOLVED BY TEAM HADI.pdf (PDF · Midterm)
- CS502 MIDTERM FILE 2 SOLVED BY TEAM HADI.pdf (PDF · Midterm)