0% found this document useful (0 votes)
9 views17 pages

Lecture 1.2

The document outlines a course on Data Structures and Algorithms taught by Mr. Shoaib Khan at the University of Management & Technology. It includes his academic background, teaching experience, and course contents covering topics such as data types, algorithms, and object-oriented programming concepts. Additionally, it emphasizes classroom rules, academic integrity, and provides an overview of composition and aggregation in programming.

Uploaded by

noobscaferen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

Lecture 1.2

The document outlines a course on Data Structures and Algorithms taught by Mr. Shoaib Khan at the University of Management & Technology. It includes his academic background, teaching experience, and course contents covering topics such as data types, algorithms, and object-oriented programming concepts. Additionally, it emphasizes classroom rules, academic integrity, and provides an overview of composition and aggregation in programming.

Uploaded by

noobscaferen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

University of Management &

Technology
Data Structures & Algorithm

Introduction

Mr. Shoaib Khan


[email protected]

Lecture No. 1.2


About me
• Studies
– MS(CS) – Bahria University (2018-2021)
– BS(CS)- FAST-NU (2011-2015)
• Teaching Experience
– Lecturer – University of Management & Technology
(2022-Present)
– Sr. Lecture – Bahria University Lahore (2021-2022)
– Lab Engineer– Bahria University Lahore (2018-2021)
• Industry Experience
– Software Engineer – PlumLogix ( 2016-2017)
– Software Engineer – SOCO-Engineer gmbh (2015-2016)
About me
Office: CB1-508-6
Office hours –

Day 11:00-12:15 12:15-2:00


Monday
Student Advisory Hour

Wednesday
Student Advisory Hour

Thursday
Student Advisory Hour
Some Rules
– Raise your hand before asking any question and then
WAIT for the permission
– Never ever miss a class
– Never ever “sleep” in the class
– Never use mobile phones in the class
Dishonesty, Plagiarism

• All parties involved in any kind of cheating in any


exam (Quizzes, Assignments & Projects) will get
minus (-) 50% in that exam
Dishonesty, Plagiarism
You can fool some of the people all of the time,
and all the people some of the time,

but you can not fool all of the people all of the
time.
Abraham Lincoln,
16th president of US (1809 - 1865)
General Overview
Introduction to
Computer Science

What is Hardware, Software, Programming, Operating System etc

Computer
Programming

How to write software with the help of procedural and object oriented
programming?

Data Structures

How to efficiently utilize memory with the help of different data structures?

Algorithm
Analysis

How to efficiently solve complex problems?


Course Contents
• Introduction
• Revision of Previous concepts
• Complexity Analysis
• Simple Data Types and Abstract Data Types
• Arrays and Lists
• Elementary Data Structures
• Stack and Queues
• Trees and Graphs
• Set structure
• Searching techniques
• Hashing
• Sorting techniques
OOP Concepts
• Abstraction
• Abstract vs Concrete
• Composition vs Aggregation
• Inheritance
• Polymorphism
• Friend Function & Operator Overloading

• Reference
• https://drive.google.com/drive/folders/
1qwJisoVShTqJFPEeQdykY3mkGfj0YaWB?usp=sharing
Quiz-01
Composition
Consider the following implementation of the
student class:

Student
gpa : float
rollNo : int
name : char *

Student(char * = NULL, int = 0,


float = 0.0);
Student(const Student &)
GetName() const : const char *
SetName(char *) : void
~Student()

Composition
►C++: “it’s all about code reuse”
►Composition:
Creating objects of one class inside another class
►“Has a” relationship:
 The bird has a beak
Student has a name
Composition
Conceptual notation:

Student
gpa : float
rollNo : int String
name : String string : char *
Student(char * = NULL, int = 0,
float = 0.0); String()
Student(const Student &) SetString(char *) : void
GetName() const : String GetString() const : const char *
GetNamePtr() const : const char * ~String()
SetName(char *) : void …
~Student()

Composition
►Constructors of the sub-objects
are always executed before the
constructors of the master class

►Example:
Constructor for the sub-object name
is executed before the constructor of
Student
Composition
Now consider the following case:

String
name: char *
Student
String()
… String(char *)
name : String ~String()
birthDate : Date …

Student()
Student( char *, Date
const Date &, int, float)
SetName(char *) : void day: int
GetName() : char * Month: int
~Student() year: int
… …
Date()
Date(int,int,int)
Date(const Date &)

Aggregation
Composition vs. Aggregation
►Aggregation is a weak relationship

Room Chair
area : float …
chairs[50]:Chair *
Chair()
DoSomething() : void
Room(char *, int)
FoldChair() : bool
~Room()
UnFoldChair() : bool
FoldChair(int) : bool
~Chair()


Aggregation
►In aggregation, a pointer or reference to an object is
created inside a class
►The sub-object has a life that is NOT dependant
on the life of its master class
►e.g:
Chairs can be moved inside or outside at anytime
When Room is destroyed, the chairs may or may
not be destroyed

You might also like