Cs-502 ppt slides Lecture1-18-merged by SeHr_BiZ.pdf

Verified academic study resource for CS502 (Fundamentals of Algorithms) under the Computer Science at Virtual University of Pakistan. This PDF document (Official Lecture Handouts & Highlighted Notes) covers Complete Course Handouts (Lectures 1 to 45) spanning approximately 450 pages across 8 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
PDF
Type
Handout
Coverage
Complete Course Handouts (Lectures 1 to 45)
Tags
LECTURE, SLIDES

Virtual University examiners construct 100% of objective MCQs and subjective marking schemes directly from the official CS502 handouts.

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)
  5. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  6. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  7. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  8. Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)

Frequently asked questions

Where can I download Cs-502 ppt slides Lecture1-18-merged by SeHr_BiZ.pdf for free?

You can preview and download "Cs-502 ppt slides Lecture1-18-merged by SeHr_BiZ.pdf" (CS502 PDF, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs-502-ppt-slides-lecture1-18-merged-by-sehr-biz-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 Complete Course Handouts (Lectures 1 to 45) across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), 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

Algorithms
Lecture # 01

       Dr. Sohail Aslam

Design and analysis of Algorithms

Model of Computation

Model of Computation

Preliminaries

Preliminaries

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

Origin of Word: ALGORITHM

ALGORITHM informal definition

ALGORITHM, programming

ALGORITHM, programming

Why Study?

Why Study?

Why Study?

Why Study?

Course outline

Course outline

Course outline

Course outline

Criteria for analyzing Algorithms

Criteria for analyzing Algorithms

Model of Computation

Model of Computation

Model of Computation

Random Access Machine

Random Access Machine
 • A RAM is an idealized machine with an
  infinitely large random-access memory.
 • Instructions are executed one-by-one (there
  is no parallelism).
 • Each instruction involves performing some
  basic operation on two values in the
  machine’s memory

                                                 Algorithms – p. 24

Basic RAM Operations

Basic operations include
 • assigning a value to a variable,

 • computing any basic arithmetic operation (+, -
   , × and division) on integer values of any size
 • performing any comparison or boolean
   operations
 • accessing an element of an array (e.g. A[10])

                                                Algorithms – p. 25

RAM Model
 • We assume that each basic operation takes
  the same constant time to execute.
 • The RAM model does a good job of
  describing the computational power of most
  modern (nonparallel) machines.

                                               Algorithms – p. 26

RAM Model

Basic operations in C++ that are assumed to
take up same amount of CPU time.
 • x    = y;
 • z    = a + b;   z = a - b;
 • z    = a * b;   z = a / b;
 • z    = w[10];
 • (x    <= y)

                                              Algorithms – p. 27

Example: 2-dimension maxima

Let us do an example that illustrates how we
analyze algorithms.
 • Suppose you want to buy a car.

 • You want the pick the fastest car.

 • But fast cars are expensive; you want the
   cheapest.
 • You cannot decide which is more important:
   speed or price.

                                                Algorithms – p. 28

Example: 2-dimension maxima
 • Definitely do not want a car if there is another
  that is both faster and cheaper.
 • We say that the fast, cheap car dominates the
  slow, expensive car relative to your selection
  criteria.
 • So, given a collection of cars, we want to list
  those cars that are not dominated by any
  other.

                                                     Algorithms – p. 29

Example: 2-dimension maxima

Here is how we might model this as a formal
problem.
 • Let a point p in 2-dimensional space be given
   by its integer coordinates, p = (p.x, p.y).
 • A point p is said to be dominated by point q if
   p.x ≤ q.x and p.y ≤ q.y.

                                                 Algorithms – p. 30

Example: 2-dimension maxima
 • Given a set of n points, P = {p1 , p2 , . . . , pn } in
   2-space a point is said to be maximal if it is
   not dominated by any other point in P.

                                                        Algorithms – p. 31

Example: 2-dimension maxima

The car selection problem can be modelled this
way:
For each car we associate (x, y) pair where

 • x is the speed of the car and

 • y is the negation of the price.

                                                 Algorithms – p. 32

Example: 2-dimension maxima
 • High y value means a cheap car and low y
  means expensive car.
 • Think of y as the money left in your pocket
  after you have paid for the car.
 • Maximal points correspond to the fastest and
  cheapest cars.

                                                 Algorithms – p. 33

Example: 2-dimension maxima

2-dimensional Maxima:
 • Given a set of points P = {p1 , p2 , . . . , pn } in
   2-space,
 • output the set of maximal points of P,

 • i.e., those points pi such that pi is not
   dominated by any other point of P.

                                                          Algorithms – p. 34

Example: 2-dimension maxima

   14
                     (7,13)
   12                             (12,12)
             (4,11) (9,10)
   10                                 (14,10)

   8                 (7,7)                (15,7)
   6                         (11,5)
        (2,5)
   4         (4,4)               (13,3)
   2
               (5,1)

        2 4 6        8 10 12 14 16 18
                                                   Algorithms – p. 35

Example: 2-dimension maxima
 • Our description of the problem is at a fairly
  mathematical level.
 • We have intentionally not discussed how the
  points are represented.
 • We have not discussed any input or output
  formats.
 • We have avoided programming and other
  software issues.

                                                   Algorithms – p. 36

Example: 2-dimension maxima

2-dimensional Maxima:
 • Given a set of points P = {p1 , p2 , . . . , pn } in
   2-space,
 • output the set of maximal points of P,

 • i.e., those points pi such that pi is not
   dominated by any other point of P.

                                                          Algorithms – p. 34

Example: 2-dimension maxima

   14
                     (7,13)
   12                             (12,12)
             (4,11) (9,10)
   10                                 (14,10)

   8                 (7,7)                (15,7)
   6                         (11,5)
        (2,5)
   4         (4,4)               (13,3)
   2
               (5,1)

        2 4 6        8 10 12 14 16 18
                                                   Algorithms – p. 35

Example: 2-dimension maxima
 • Our description of the problem is at a fairly
  mathematical level.
 • We have intentionally not discussed how the
  points are represented.
 • We have not discussed any input or output

More CS502 files

All CS502 files · Midterm Prep 2026 · MCQs Bank