You are on page 1of 22

DATA STRUCTURES AND ALGORITHMS

01
INTRODUCTION TO COURSE
ALGORITHMS & DATA STRUCTURES

IMRAN IHSAN
ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD
WWW.IMRANIHSAN.COM

LECTURES ADAPTED FROM:


DANIEL KANE, NEIL RHODES
DEPARTMENT OF CS & ENGINEERING
UNIVERSITY OF CALIFORNIA, SAN DIEGO
AUTOMATE THIS

2 MILLION SPEECH PATTERNS


IDENTIFY A CALLER'S PERSONALITY STYLE
DIRECT THE CALLER WITH A COMPATIBLE
CUSTOMER SUPPORT REPRESENTATIVE

2
9 ALGORITHMS THAT CHANGED
THE FUTURE
1. Search Engine Indexing – Finding Needles in the World’s Biggest Haystack
2. PageRank – The Technology That Launched Google
3. Public-key Cryptography - Sending Secrets on a Postcard
4. Error-Correcting Codes - Mistakes That Fix Themselves
5. Pattern recognition - Learning from Experience
6. Data Compression - Something for Nothing
7. Database - The Quest for Consistency
8. Digital Signatures - Who Really Wrote This Software?

3
GOOGLE MAPS
HTTPS://MAPS.GOOGLE.COM

4
ALGORITHMS

• An algorithm is a set of instructions that state how a task is to be performed.

• A Knitting Pattern

• Setting up a new XBOX Console

• Recipe for Cooking Pizza

• Directions for Walking to Cafeteria Building

• Operations to turn an MP3 File in a sequence of sounds produced by an MP3 Player.

An algorithm is an ordered, deterministic,


executable, terminating set of instructions.

5
ALGORITHMS
ON COMPUTERS

• The abstract specification of the processes that are running on all of our computers, phones,
games consoles, databases, autopilots, banking systems, autonomous vehicles, networks, ...

• Algorithms process information maintained in data structures, and produce actions and
results.

6
ALGORITHM

• We'll see a more efficient version


of this algorithm
later this semester
which relies on an
efficient data
structure underneath.

7
DATA STRUCTURES
The frameworks we use to maintain the data that are processed by the algorithms.
Inside data structures, we use algorithms to manipulate the data efficiently.

8
ABSTRACT DATA TYPES
higher level patterns for organizing data structures
patterns for reading data from the structure, for removing data, and for adding new data.

9
ABSTRACT DATA TYPES

• think of this sketch of a 'graph' as an abstract data type

10
DATA STRUCTURE

• 2D matrix implementing the graph

11
ALGORITHMS: THREE QUESTIONS

Does it do How much


what it is How long space does
supposed will it take? it need to
to do? run?

12
WHAT IS THE POINT?

1. Your programs must be correct


• not just bug-free code,
• but implementing an algorithm that does what it is supposed to do.

2. Your programs should be efficient


• programs that take too long to run are useless
• understand the implication of choosing different library functions
• understand the implication of choosing different design patterns
• what may be easier for you to code may be much worse to run …

1. Faster machines means users expect to solve bigger problems


2. Some problems have known limits on their efficiency

Yawn – machines are getting faster every year


– who cares about efficiency?

13
WHAT IS THE POINT?

3. You must be able to advertise your code to other programmers in terms they will
understand
• state what (agreed) abstract data types you are using
• also state what data structures and algorithms you have used to implement them

4. You should not subvert the design pattern


• understand the specified ways to interact with the data
• don't interact with it in other ways
• abandons correctness and efficiency
• don't allow other programmers to subvert the design

14
PROGRAMMING, CODING…

This ain't chemistry - this is art.


Coding is art.
And the shit I code is the bomb,
so don't be telling me.

The shit you code is shit.


You and I will not make garbage.
We will produce a chemically pure and stable product
that performs as advertised.
No adulterants. No baby formula. No chili powder.

15
... AND A FOURTH QUESTION

• How do we implement that?

• We are going to use C++ or JAVA or Python.


• understand the library functions
• learn how to implement structures and algorithms efficiently

• The module is a mix of theory and practice.

16
COURSE OBJECTIVE

Gain expertise in the use and implementation of simple data structures

Their application in the creation of efficient software

Apply data structures and algorithms appropriately in formulating solutions of


meaningful computational problems

Implement computer applications employing simple data structures in a modern


programming language

Implement simple data structures using array-based techniques and linked lists.

17
WEB RESOURCES
IMRANIHSAN.COM

18
HUMAN COMPUTER INTERACTION
INTRODUCTION TO UI DESIGN

• Class Participation
• Homework

Key Features
• Assignment
• Quiz
• Exam
• Lab Assignment

19
HUMAN COMPUTER INTERACTION
GRADING SCHEME

20%
Assignments

50%
10% Quiz
Passing Marks

Marks 80%
10% Lab Grading
Distribution to get “A”

20% Midterm No “D” Grade

40% Final

20
INSTRUCTOR
IMRAN IHSAN

Consultation Direct general questions


• Drop in whenever my • Those that other
door is open and I am on students may also be
my seat. wondering about and
• That Google can’t answer

21
PROGRAMMING FOUNDATIONS
WE ASSUME THAT YOU KNOW ALMOST EVERYTHING IN

Programming C++:
Datatypes, Conditions, Loops, Arrays, Multi Dimension
Arrays, Pointers, Functions, Pass By Value, Pass By
Reference

Object Oriented Programming:


Data Abstraction, Classes, ADT, Operator Overloading,
Inheritance, Polymorphism, Virtual Functions, This, New,
Delete, Uses-A, Knows-A, Templates

OOP++
STL, Design Pattern, Model-View-Controller, Factory
Method, Iterator Design, Composite Design,

22

You might also like