Sunteți pe pagina 1din 56

Distribution of Candidates

Candidates

Students

20

Faculty PhD
North
South
East
West

Faculty PhDP

21

Faculty PG

36

Faculty G

20

40

No
6/5/2012 7:11 PM

Copyright @ gdeepak.com

Reasons to Join
Why you are here

8%

5%

15%

9%
11%
37%
15%

6/5/2012 7:11 PM

Copyright @ gdeepak.com

Help in PhD
Enhance teaching
Update Knowledge
Learn Advanced Topics
Refresh Algorithm Skills
To do quality Research
Love Algorithms

Knowing Each Other

6/5/2012 7:11 PM

Copyright @ gdeepak.com

6/5/2012 7:11 PM
Copyright @ gdeepak.com

Writing a research paper

Resource sharing

Problem solving

Blog and group mailing

To present a new idea

To make groups of
similar interests

To discuss your problem

Mentorship

Your Contribution

Prerequisites
Interest in Algorithms
One Programming Language
Commitment to Persevere

6/5/2012 7:11 PM

Copyright @ gdeepak.com

Level of Expertise as a algorithmist


Innovator
Expert
Proficient
Competent

Beginner
6/5/2012 7:11 PM

Intuition, Critical thinking,


continuous learning and selfimprovement, Applies in context
Big picture, systems thinking
Addresses important aspects,
ignores irrelevant, Deep
understanding of rules, theories
and alternatives
solve new problems, Conceptual
understanding, active decision
making
All Problems are equal, No big
picture
Decision for standard situations
Copyright @ gdeepak.com
9

Motivation for the


Fundamental and core courses for any research in
computer science
Future of computing lies in algorithms
Very important to be a computer engineer and required
throughout your studies and career

Must for getting any placement

6/5/2012 7:11 PM

Copyright @ gdeepak.com

10

Objectives
Knowledge
of
data
structures,
algorithm analysis
and algorithm
design
To apply appropriate algorithmic
techniques and improving it for
efficiency based on problem at hand
To inculcate research mindset to
produce good research
6/5/2012 7:11 PM

Copyright @ gdeepak.com

11

Skills to be acquired
To use various operations concerning each data structure for
various applications
To have a good tool set for algorithm design for a given problem
To analyze the given algorithm in terms of complexity

To develop intuition and see the beauty of algorithm structures


How to teach and How to do research on algorithms and data
structures
6/5/2012 7:11 PM

Copyright @ gdeepak.com

12

Course Coverage
Data Structure
Algorithm Analysis and Design
Advance Data Structures

Advanced Algorithms
Part of Discrete Math, Graph Theory, Programming Language
Structures and many others
6/5/2012 7:11 PM

Copyright @ gdeepak.com

13

References and Resources


Algorithm Design from
Addison Wesley by Jon
Klienberg and Eva
Tardos

Introduction to
Algorithms from PHI
by Cormen, Leiserson,
Rivest and Stein Third
Edition

Algorithm Design from


Wiley by Goodrich and
Tamassia

The Design and


Analysis of Computer
Algorithms from
Addison Wesley-Alfred
Aho, Hopcroft, Ullman

6/5/2012 7:11 PM

Copyright @ gdeepak.com

14

References and Resources contd..


Computer Algorithms:
Introduction to Design
and Analysis from
Addison WesleyS.Baase

Art of Computer
Programming : Vol1,
Vol 2, Vol3 and Vol4
from Addison WesleyDE Knuth

Fundamental of
Computer Algorithms:
Silicon Press E.
Horowitz and S Sahni
6/5/2012 7:11 PM

Copyright @ gdeepak.com

algorithmguru.com
gdeepak.com

15

References and Resources contd..


Algorithms from Pearson
by Johnsonbaugh and
Schaefer

F P Preparata and M I
Shamos, Computational
Geometry: An Introduction,
Springer-Verlag

Approximation Algorithms
by Springer from Vijay v
Vazirani

Randomized Algorithms
from Cambridge by R
Motwani and P Raghvan

6/5/2012 7:11 PM

Copyright @ gdeepak.com

16

References and Resources contd..


Algorithms
from
McGrawHill by Dasgupta,
Papadimitriou & Vazirani

Algorithms and Theory of


Computation Handbook
Volume I,II by CRC Press
by Atallah and Blenton

Programming Pearls from


Addison
Wesley
by
Bentley

Algorithms for Interviews


by Aziz and Parkash

6/5/2012 7:11 PM

Copyright @ gdeepak.com

17

Administration
Kindly be
on time so
as not to
skip
important
concepts.

6/5/2012 7:11 PM

Questions
are
encouraged
please raise
hand if you
have any.

Copyright @ gdeepak.com

Prizes for
the
Questions
at the end
of the
session

18

Unit Coverage
Memory hierarchy

Evolution of computers
Definition of data structure
Definition of algorithms
Desirable characteristics of an algorithm

Number system
6/5/2012 7:11 PM

Copyright @ gdeepak.com

19

Memory Hierarchy
32 or 64 bit Registers 512 bytes 1 Cycle
s
i
z
e

L1 Cache (Internal cache)-SRAM 64-512 KB 4-8 Cycles


L2/L3 Cache (External cache)-SRAM 1-4 MB 8-80 cycles

DRAM-Main memory 4-32 GB 100-1000 cycles


Hard Disk-Secondary storage (Mechanical Part) 1TB 106Cycles

s
p
e
e
d

c
o
s
t
/
b
y
t
e

External storage Floppy, CD, DVD, Flash drive


6/5/2012 7:11 PM

Copyright @ gdeepak.com

20

Evolution-Application users
1980s- Standalone systems, LAN, WAN,MAN at most
100000(105 ) users for few applications
1990s- start of www, global applications for reservations, share
markets etc. (107) scale of transactions
2000-2005- Rapid growth of Internet, search engines systems
catering to 109 (1 billion) transactions emerged
2005-2012- Exponential growth. Systems with 1011
transactions and projects with traffic (1013 ) of 10 trillion scale
(social networking sites) Devices reach trillion unit mark.
6/5/2012 7:11 PM

Copyright @ gdeepak.com

21

Evolution-Processing devices

Vacuum Tubes
Transistors
ICs (few)
SSI (scale of 10)
MSI(scale of 100)
LSICs (scale of 10000)
VLSICs (scale of 105)
ULSICs (scale of 107 -109)
WSIs ( Future)

6/5/2012 7:11 PM

Copyright @ gdeepak.com

22

Evolution-Processor Speed
Thousand instructions per second (Kilo) 103
Million instructions per second Mega-106

Billion instructions per second Giga-109


Trillion instructions per second Tera-1012

Quadrillion instructions per sec Peta-1015 K Computer , Japan , 10 QIPS


Quintillion instructions per second Exa- 1018 (Future)
6/5/2012 7:11 PM

Copyright @ gdeepak.com

23

Evolution-Memory
Byte 23
Kilo 210
Mega 220
Giga 230

Tera 240 (4 TB available)


Peta 250 (Achieved by Integration)
Exa bits of memory 260 (Future)
Zetta 270
Yotta 280 (Amount of data on the web)
6/5/2012 7:11 PM

Copyright @ gdeepak.com

24

Evolution-Processors
8bit processors
16 bit processors
32bit processors
64 bit processors
128 bit processors
256 bit processors (Future)
6/5/2012 7:11 PM

Copyright @ gdeepak.com

25

Evolution- Programming Languages

HLLs

4GLs

Assembly Language

Machine Code
6/5/2012 7:11 PM

Copyright @ gdeepak.com

26

Evolution-Programming

Structured

Object
oriented
languages

Auto
generation
of code

Procedural

6/5/2012 7:11 PM

Copyright @ gdeepak.com

27

Evolution-Data

Numbers

Audio

6/5/2012 7:11 PM

Chars

Text

Video

Copyright @ gdeepak.com

Graphics

Interactive
multimedia

28

Data Structure-Definition
Data structure is a way to store and organize
data in order to facilitate access and
modifications.
If the strengths and limitations of a structure
will be known, then we can utilize the best
one available for a given project/application.
6/5/2012 7:11 PM

Copyright @ gdeepak.com

30

Algorithm-Definition
Algorithm is a sequence of finite and unambiguous
computational steps that transform the input into correct
output effectively.
Finite theoretically means having finite number of steps,
but for an algorithm to be effective finite amount has to be
within reasonable limits of computing resources.
In some cases incorrect solutions are acceptable within the
range of allowed error, where correct algorithms are not
available with limitation of current resources.
6/5/2012 7:11 PM

Copyright @ gdeepak.com

31

About Algorithms
Algorithms form the language to cleanly express the underlying
questions with the solutions to the extent possible
Should give enough detail for a person to understand, analyse
and implement the algorithm.
The set of universes and all the species may be under a state of
execution of The best and beautiful algorithm developed by
Supreme Personality - Unknown
Great algorithms are the poetry of computation. Just like verse,
they can be terse, allusive, dense, and even mysterious. But once
unlocked, they cast a brilliant new light on aspects of computingFrancis Sullivan
6/5/2012 7:11 PM

Copyright @ gdeepak.com

32

Algorithms-Why
Assume we have infinite speed processors with infinite
memory, do we still need to study algorithms?

Yes! It is an art It is fun Why people run in a race. Even if


there are cars and airplanes.
Devising best algorithm for a given problem under given
resources will always be a challenge
To keep brain in shape, make better systems and save world
6/5/2012 7:11 PM

Copyright @ gdeepak.com

33

Proving correctness of algorithms


Proving algorithms correct is a difficult area.
All basic algorithms has been proved correct using
assertions, predicate logic and mathematics.
It is not possible to prove todays algorithms , So testing is
only way out. It is not a correct way but a practical way.
To test a match-box, you cannot light up all match-sticks

But in many cases mathematic rigor is required e.g.


correctness of guided missile or A communication Satellite
6/5/2012 7:11 PM

Copyright @ gdeepak.com

34

Examples of complex applications


Online
Banking

Shopping

Reservation

Network
routing

Biotechnology

Modelling
and
simulations

Space
Exploration

Network
Analysis

Social
crowds

6/5/2012 7:11 PM

Copyright @ gdeepak.com

35

Constituents of studying algorithms


Given A
Problem

What Should be the algorithm for this problem


Is it correct

How long Will it take to run.


Can I do better.

Implementing this algorithm


6/5/2012 7:11 PM

Copyright @ gdeepak.com

36

Algorithm characteristics
Modularity
Scalability
Graceful Degradation for size and number of inputs
Maintainability

Simple
User friendly
6/5/2012 7:11 PM

Copyright @ gdeepak.com

38

Algorithm characteristics contd..


Concurrency
Distributed
Secure
Power Efficient
Hardware/OS compliant
6/5/2012 7:11 PM

Copyright @ gdeepak.com

39

Modularity
Composed of smaller chunks of code that can be isolated from
other code.
Less development time because different teams can make
different modules
Manageable for the purpose of implementation

Module having specific functionality may be reused in other


applications
Libraries, APIs, frameworks, open source offerings, kernels,
command-line utilities
6/5/2012 7:11 PM

Copyright @ gdeepak.com

40

Scalability
Capability of a system to handle increasing load or growth, or up
to what input your algorithm is scalable
It can be geographic scalability, functional scalability or load
scalability
Horizontal scaling : increasing server capacity by adding more

Vertical Scaling: Adding more processors or memory in existing


server
If routing table grows as function of logn where n is no of nodes
in network then that routing protocol is scalable.
6/5/2012 7:11 PM

Copyright @ gdeepak.com

41

Graceful degradation
Another term for fault tolerance

System does not breaks down but continues to work in a degraded


manner in case of failure or more than expected load. The degradation
should be in proportion to the severity of failure.
It also applies to new versions of software, languages and web browsers.
When files of older versions are run on them they still run them, these
are called backward compatible.

If older versions of software, web browsers are able to run files of new
versions, these are called forward compatible
6/5/2012 7:11 PM

Copyright @ gdeepak.com

42

Maintainability
Which is flexible to patchwork with least disturbance to the
system.
Corrective or adaptive maintainability
It should be understandable and documented from the
perspective of different stakeholders

It should be readable and traceable


Complex systems resist any change
6/5/2012 7:11 PM

Copyright @ gdeepak.com

43

Simple
Easy to understand names of variables, classes, methods
Easy and straightforward logic
Avoid unnecessary nesting of loops
Good comments
Consistent coding and mnemonics
6/5/2012 7:11 PM

Copyright @ gdeepak.com

44

User Friendly
Load Speed
Exit option

Easy to navigate
Pleasant GUI
Easy to install, update and uninstall
Portable

Does not depends upon third party tools


6/5/2012 7:11 PM

Copyright @ gdeepak.com

45

Secure
It does not contains any malicious code
Design keeping in mind the adversary input e.g. even best hashing
strategies may fail due to specific input
It takes care of the specific input to slow down or stall the system
It is protected against the currently known attacks

Critical and vulnerable areas of code are encapsulated


6/5/2012 7:11 PM

Copyright @ gdeepak.com

46

Concurrency
Ensuring correct sequencing of interactions between
different computational executions
Users accessing the shared resources in way unknown to
each other
Implementing each request as a separate thread or a
process depending upon availability of parallel processors
or distributed processing systems
6/5/2012 7:11 PM

Copyright @ gdeepak.com

47

Power Efficiency
Battery Life has become one of the important
considerations for all devices and power cost for data
centers is one of the major concerns.
E.g. using power efficient UI, Flash is less user friendly as
compared to HTML because of lot of wakeup calls
Some video formats use hardware accelerated codecs
instead of processor which saves power
Minimize data movements to save disk spins

Using proper instructions and binary formats


6/5/2012 7:11 PM

Copyright @ gdeepak.com

48

Distributed
Processor, Data, memory and network resources are
distributed having multiple channels of access.
If any node, component or location fails to respond
there is always an alternative mechanism.
Distribution can be logical, Physical.
Dependence on multiple power sources, multiple
storage systems, multiple network providers etc.

6/5/2012 7:11 PM

Copyright @ gdeepak.com

49

Performance is the key


Performance draws line between feasible and impossible.
Algorithms give language for talking about program
behavior. Performance can be used to "pay" for other
things, such as security, features and user-friendliness

6/5/2012 7:11 PM

Copyright @ gdeepak.com

50

Algorithm Engineering

6/5/2012 7:11 PM

Copyright @ gdeepak.com

51

Number System
Binary Number
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
6/5/2012 7:11 PM

Octal Number
0
1
2
3
4
5
6
7
10
11
12
13
14
15
16
17

Decimal Number
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Copyright @ gdeepak.com

Hexadecimal Number
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
52

Questions, Suggestions and Comments

6/5/2012 7:11 PM

Copyright @ gdeepak.com

53

Question 1
We interchange values of variables m and n, using
replacement notation by t m, m n, n t. So we use
three assignments. If we want to rearrange (a, b, c, d) to (b,
c, d, a) by a sequence of replacements. The new value of a is
to be the original value of b & so on. How many
assignments are required?

6/5/2012 7:11 PM

Copyright @ gdeepak.com

54

Question 2
(96.28)10 = ( _______)16
A)60.47AE14
B)A.FCBD
C)60.4E7
D)60.8765

6/5/2012 7:11 PM

Copyright @ gdeepak.com

55

Question 3
What will be the output of the following program
main()
{
char *s1 = "ABCDE";
char *s2 = "AB";
while(*s1 == *s2)
{
if (* s1 =='\0' || *s2 == '\0')
break;
s1++ ;
s2++;
}
if(*s2 == '\0')
printf("ABC") ;
else
printf("XYZ");
}
6/5/2012 7:11 PM

Copyright @ gdeepak.com

56

S-ar putea să vă placă și