- Type
- Midterm past paper
- Course
- CS502 Fundamentals of Algorithms
- Size
- PDF 1.1 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 28. Download the file for all 28 pages.
( Marks: 1 ) - Please choose one
1.Random access machine or RAM is a/an
Machines build by Al-Khwarizmi
Mathematical model (lec#2 pg#10)
2._______________ is a graphical representation of an algorithm
Σ notation Θ notation
Flowchart( refrence cls10 chapter no1)
- A RAM is an idealized machine with ______________ random-access memory.
256MB 512MB
an infinitely large (page#10)
100GB
4.What type of instructions Random Access Machine (RAM) can execute? Choose best
Arithmetic and logic(page#10)
5.What will be the total number of max comparisons if we run brute-force maxima
n n
n n n
Answe is option 3
6. What is the solution to the recurrence T(n) = T(n/2)+n. O(logn) (not sure)
O(n)
O(nlogn)
O( n )
What is the order of execution for this code.
O(n)
O(
n )
n )
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 (lec#9)
Q9. What is the total time to heapify?
(Olog n) (page#43)
(n log n) n log n) log n)
- When we call heapify then at each level the comparison performed takes time It will take (1)
It will take (log n)
- In Quick sort, we don’t have the control over the sizes of recursive calls True(page#49)
False Less information to decide Either true or false
Q12. Is it possible to sort without making comparisons?
Yes (pge#57)
No
Q13. If there are 𝛉 (1 marks)
n entries in edit distance matrix then the total running
(1)
n ) (pg#84)
(n) (n log n)
- For Chain Matrix Multiplication we can not use divide and conquer approach because, We do not know the optimum k (pg#86)
We use divide and conquer for sorting only We can easily perform it in linear time Size of data is not given
- The Knapsack problem belongs to the domain of _______________ problems. Optimization (pg#91)
NP Complete Linear Solution Sorting
- Suppose we have three items as shown in the following table, and suppose the capacity of the knapsack is 50 i.e. W = 50.
Items 1 and 2 Items 1 and 3 Items 2 and 3 None of these
answer
- Algebraic and logic
- Geometric and arithmetic
3. Arithmetic and logic (rep)
- Parallel and recursive
- Machine build by Al-Khwarizmi
- Mechanical machine
- Electronics machine
Related CS502 files
All CS502 files →- CS502 Midterm Solved Paper with References by Waqar Siddhu Midterm ZIP 3.2 MB
- CS502 Midterm Solved Subjective with References by Moaaz Midterm DOCX 163 KB
- CS502 Midterm Past Papers File 2 Midterm PDF 3.8 MB
- CS502 Midterm Grand Quiz Midterm PDF 1.4 MB
- CS502 Final Term Highlighted Handouts by Masters Highlighted PDF 5.2 MB
- CS502 Quiz 1 Lectures 1-10 by Junaid Quiz PDF 1.8 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.