CS502 Midterm Solved Mcqs with References by Moaaz.doc

Verified academic study resource for CS502 (Fundamentals of Algorithms) under the Computer Science at Virtual University of Pakistan. This DOC document (Midterm Solved Past Paper & Revision File compiled by Moaaz Siddhu) 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
DOC
Type
Midterm
Coverage
Mid-Term Exam Scope (Lectures 1 to 22)
Compiled by
Moaaz Siddhu
Tags
MCQ, SOLVED, 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

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. 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 Solved Mcqs with References by Moaaz.doc for free?

You can preview and download "CS502 Midterm Solved Mcqs with References by Moaaz.doc" (CS502 DOC, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs502-midterm-solved-mcqs-with-references-by-moaaz-doc) 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- Fundamentals of Algorithms
Solved MCQS
From Midterm Papers

Provide by VUAnswer.com

May- 24 - 2013

MC100401285
Moaaz.pk@gmail.com          Mc100401285@vu.edu.pk
PSMD01

MIDTERM   EXAMINATION
Fall 2011
CS502- Fundamentals of Algorithms

Question No: 1    ( Marks: 1 )    - Please choose one
Due to left complete nature of binary tree, the heap can be stored in

► Arrays (Page 40)
► Structures
► Link Lis
►Stack

Question No: 1    ( Marks: 1 )    - Please choose one
What type of instructions Random Access Machine (RAM) can execute?

        ►Algebraic and logic
        ►Geometric and arithmetic
        ►Arithmetic and logic (Page 10)
        ►Parallel and recursive

Question No: 1    ( Marks: 1 )    - Please choose one
For Chain Matrix Multiplication we can not use divide and conquer approach because,

        ►We do not know the optimum k (Page 86)
        ►We use divide and conquer for sorting only
        ►We can easily perform it in linear time
        ►Size of data is not given

Question No: 1    ( Marks: 1 )    - Please choose one
What is the total time to heapify?

       ► Ο(log n) (Page 43)
       ► Ο(n log n)
       ► Ο(n2 log n)
       ► Ο(log2 n)

Question No: 1    ( Marks: 1 )    - Please choose one
word Algorithm comes from the name of the muslim author  ____________

►Abu Ja’far Mohammad ibn Musa al-Khowarizmi.

Question No: 1    ( Marks: 1 )    - Please choose one
al-Khwarizmi’s work was written in a book titled _______________

►al Kitab al-mukhatasar fi hisab al-jabr wa’l-muqabalah

MIDTERM   EXAMINATION
Spring 2010
CS502- Fundamentals of Algorithms

Question No: 1    ( Marks: 1 )    - Please choose one
Random access machine or RAM is a/an

       ► Machine build by Al-Khwarizmi
       ► Mechanical machine
       ► Electronics machine
       ► Mathematical model (Page 10)

Question No: 2    ( Marks: 1 )    - Please choose one
_______________ is a graphical representation of an algorithm

       ►  notation
       ► notation
       ► Flowchart    Click here for detail
       ► Asymptotic notation

Question No: 3    ( Marks: 1 )    - Please choose one
A RAM is an idealized machine with ______________ random-access memory.

       ► 256MB
       ► 512MB
       ► an infinitely large (Page 10) www.VUAnswer.com
       ► 100GB

Question No: 4    ( Marks: 1 )    - Please choose one
What type of instructions Random Access Machine (RAM) can execute? Choose best answer

       ► Algebraic and logic
       ► Geometric and arithmetic
       ► Arithmetic and logic (Rep)
       ► Parallel and recursive

Question No: 5    ( Marks: 1 )    - Please choose one
What will be the total number of max comparisons if we run brute-force maxima algorithm with n elements?
       ►
       ►
       ►  (Page 14)
       ►

Question No: 6    ( Marks: 1 )    - Please choose one
What is the solution to the recurrence T(n) = T(n/2)+n .
       ► O(logn)
       ► O(n) (Page 37)
       ► O(nlogn)
       ► O(n2)

Question No: 7    ( Marks: 1 )    - Please choose one
Consider the following code:
	For(j=1; j<n;j++)
		For(k=1; k<15;k++)
			For(l=5; l<n; l++)
			{
				Do_something_constant();
			}
What is the order of execution for this code.
       ► O(n)
       ► O(n3)
       ► O(n2 log n)
       ► O(n2)

Question No: 8    ( Marks: 1 )    - Please choose one
What is the total time to heapify?
       ► Ο(log n)     rep
       ► Ο(n log n)
       ► Ο(n2 log n)
       ► Ο(log2 n)

Question No: 9    ( Marks: 1 )    - Please choose one
Consider the following Algorithm:
Factorial (n){
   if (n=1)
      return 1
   else
       return (n * Factorial(n-1))

}
Recurrence for the following algorithm is:

       ► T(n) = T(n-1) +1
       ► T(n) = nT(n-1) +1
       ► T(n)= T(n-1) +n
       ► T(n)=T(n(n-1)) +1

Question No: 10    ( Marks: 1 )    - Please choose one
 When we call heapify then at each level the comparison performed takes time

       ► It will take Θ (1)       (Page 43)
       ► Time will vary according to the nature of input data
       ► It can not be predicted
       ► It will take Θ (log n)

Question No: 11    ( Marks: 1 )    - Please choose one
In Quick sort, we don’t have the control over the sizes of recursive calls

       ► True       (Page 40)
       ► False
       ► Less information to decide
       ► Either true or false

Question No: 12    ( Marks: 1 )    - Please choose one
Is it possible to sort without making comparisons?
       ► Yes       (Page 57)
       ► No

Question No: 13    ( Marks: 1 )    - Please choose one
If there are Θ (n2) entries in edit distance matrix then the total running time is
       ► Θ (1)
       ► Θ (n2)     Click here for detail www.VUAnswer.com
       ► Θ (n)
       ► Θ (n log n)

Question No: 14    ( Marks: 1 )    - Please choose one
For Chain Matrix Multiplication we can not use divide and conquer approach because,

       ► We do not know the optimum k       (Page 86)
       ► We use divide and conquer for sorting only
       ► We can easily perform it in linear time
       ► Size of data is not given

Question No: 15    ( Marks: 1 )    - Please choose one
The Knapsack problem belongs to the domain of _______________ problems.

       ► Optimization      (Page 91)
       ► NP Complete
       ► Linear Solution
       ► Sorting

Question No: 16    ( Marks: 1 )    - Please choose one
Suppose we have three items as shown in the following table, and suppose the capacity of the knapsack is 50 i.e. W = 50.
Item
Value
Weight
1
60
10
2
100
20
3
120
30
The optimal solution is to pick

       ► Items 1 and 2
       ► Items 1 and 3
       ► Items 2 and 3 (correct)
       ► None of these

MIDTERM   EXAMINATION
Spring 2010
CS502- Fundamentals of Algorithms

Question No: 1    ( Marks: 1 )    - Please choose one
For the Sieve Technique we take time
► T(nk)     (Page 34)
►T(n / 3)
►n^2
►n/3

Question No: 1    ( Marks: 1 )    - Please choose one

More CS502 files

All CS502 files · Midterm Prep 2026 · MCQs Bank