CS502 Midterm Quiz By Danish Hanif.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 Quiz By Danish Hanif.pdf for free?
You can preview and download "CS502 Midterm Quiz By Danish Hanif.pdf" (CS502 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs502-midterm-quiz-by-danish-hanif-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 Quiz File
االسلمومکیلع!
ادیمرکاتوہںہکآپبسریختیےسوہںےگاکیفدونںیکتنحمےکدعبادمحلہلل
وروچلئویوینریٹسےکڈمرٹمااحتمنےکےیلافزلئایتررکیلںیہادیمرکاتوہںےکآپ
بسوٹسڈسٹنےکااحتمانتںیمتہبافدئہدنموہںیگ۔افزلئںیمیسکمسقیکوکیئیھب
یطلغوہیئگوہوتاسےکےیلذعمرتوخاہںیہااشنءاہللذمدیتنحمےسانافزلئوکرتہبںیئ
ےگ-آپبسوٹسڈسٹنےسزگارشےہہکامہرےویویٹبلنیچاورویبساٹیئوکافول
رکںیل-
لمکمرپیپزآوکپریمیویبساٹیئہپںیلمےگکنلےچیندایایگےہ-
Here is Website Link: https://hbdanish.me/
Here is YouTube Channel Link:
https://www.youtube.com/@Danish_Khagga
ئنم
ارگآپولگاانپ الی-امی-اسیڈنیہلرکوااناچےتہںیہایااس نبسوکزئزرکوااناچےتہ
ںیہوتاسربمنہپواسٹاپیرکںی-
📱+923231731413
https://wa.me/message/7GG2TH2MZV3OL1
CS502 Quiz File
Question 1:
Which algorithm belongs to Dynamic programming?
A) Merge sort
B) Divide and conquer
C) Heap sort
D) Edit distance
Correct Answer: D) Edit distance
Question 2:
____________ programming is essentially recursion without repetition. Select the correct
option.
A) Dynamic
B) Array
C) N log n
D) Fast
Correct Answer: A) Dynamic
Question 3:
Edit distance algorithm is based on ____________ strategy. Select the correct option.
A) Greedy
B) Divide and Conquer
C) Dynamic Programming
D) Brute force
Correct Answer: C) Dynamic Programming
Question 4:
Quicksort is a/an _______ and ________ sorting algorithm. Select the correct option.
A) Not in-place, stable one
B) Not in-place, not stable one
C) In-place, not stable one
D) In-place, stable one
Correct Answer: C) In-place, not stable one
Question 5:
The only way to convert a string of i characters into the empty string is with i deletions,
represented as _____________.
A) E(i, 0) = i
B) E(i, j) = i
C) E(0, j) = j
D) E(0, i) = j
Correct Answer: A) E(i, 0) = i
Question 6:
We can make _________ recursive calls in Fibonacci Sequence. Select the correct option.
A) Finite
B) Infinite
C) Only one
D) Zero
Correct Answer: B) Infinite
Question 7:
_____________ algorithm is based on Dynamic Programming strategy. Select the correct
option.
A) Heap Sort
B) Quick Sort
C) Binary Tree
D) Edit distance
Correct Answer: D) Edit distance
Question 8:
__________ is the process of avoiding unnecessary repetitions by writing down the results
of recursive calls and looking them up again if we need them later. Select the correct
option.
A) Function
B) Recursion
C) Memoization
D) Loop
Correct Answer: C) Memoization
Question 9:
In Dynamic Programming approach, the solution is modified/changed _________. Select
the correct option.
A) At 4th stage only
B) Only for specific problems
C) Always once
D) At each stage
Correct Answer: D) At each stage
Question 10:
What is the average running time of a quicksort algorithm? Select the correct option.
A) O(log n)
B) O(n)
C) O(n log n)
D) O(n^2)
Correct Answer: C) O(n log n)
Question #1:
In Fibonacci Sequence, each term is calculated by _______ previous ______ terms.
A) Subtracting, Two
B) Adding, Two
C) Multiplying, Two
D) Adding, Three
Answer: B) Adding, Two
Question #2:
Selection sort is a ____________ sorting algorithm.
A) In-place
B) Stable
C) In-partition
D) Not In-Place
Answer: A) In-place
Question #3:
Quick sort algorithm requires a lot of comparisons in the ____________ condition.
A) Best and Average case
B) Best case
C) Worst case
D) Average case
Answer: C) Worst case
Question #4:
________ is a linear time sorting algorithm.
A) Merge sort
B) Quick sort
C) Bubble sort
D) Radix sort
Answer: D) Radix sort
Question #5:
The only way to convert an empty string into a string of j characters is by doing j
insertions, represented as _____________.
A) E(0, j) = j
B) E(i, j) = I
C) E(1, j) = j
D) E(i, 0) = i
Answer: A) E(0, j) = j
Question #6:
Which of the following is not an application of the Edit Distance problem?
A) Speech recognition
B) Computational Molecular Biology
C) Ascending Sort
D) Spelling Correction
Answer: C) Ascending Sort
Question #7:
If there are Θ (n²) entries in the edit distance matrix, then the total running time is:
A) Θ (n log n)
B) Θ (n²)
C) Θ (1)
D) Θ (n)
Answer: B) Θ (n²)
Question #8:
What is the average running time of a quicksort algorithm?
A) O(n log n)
B) O(n^2)
C) O(n)
D) O(log n)
Answer: A) O(n log n)
Question #9:
In average-case time analysis of the quicksort algorithm, the most balanced case for
partition is when we divide the list of elements into _________.
A) Single piece exactly
B) Three nearly equal pieces
C) Two nearly equal pieces
D) Equal number of pieces as the input elements
Answer: C) Two nearly equal pieces
Question #10:
In Bucket sort, if there are duplicates, then each bin can be replaced by a __________.
A) Heap
B) Hash table
C) Linked list
D) Stack
Answer: C) Linked list
Question 1: In his book ______________, Leonardo Pisano addressed the Fibonacci
sequence as well as a variety of other problems.
a) Fibonacci
b) Fib abaci
c) Liber abaci
d) Liber fib
Answer: c) Liber abaci
Question 2: The only way to convert an empty string into a string of j characters is by
doing j insertions, represented as _____________.
a) E(i, j) = i
b) E(i, j) = IE(i, 0) = i
c) E(1, j) = j
d) E(0, j) = j
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)