Documente Academic
Documente Profesional
Documente Cultură
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
6/5/2012 7:11 PM
Copyright @ gdeepak.com
6/5/2012 7:11 PM
Copyright @ gdeepak.com
Resource sharing
Problem solving
To make groups of
similar interests
Mentorship
Your Contribution
Prerequisites
Interest in Algorithms
One Programming Language
Commitment to Persevere
6/5/2012 7:11 PM
Copyright @ gdeepak.com
Beginner
6/5/2012 7:11 PM
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
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
Introduction to
Algorithms from PHI
by Cormen, Leiserson,
Rivest and Stein Third
Edition
6/5/2012 7:11 PM
Copyright @ gdeepak.com
14
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
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
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
s
p
e
e
d
c
o
s
t
/
b
y
t
e
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
Copyright @ gdeepak.com
23
Evolution-Memory
Byte 23
Kilo 210
Mega 220
Giga 230
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
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?
Copyright @ gdeepak.com
33
Copyright @ gdeepak.com
34
Shopping
Reservation
Network
routing
Biotechnology
Modelling
and
simulations
Space
Exploration
Network
Analysis
Social
crowds
6/5/2012 7:11 PM
Copyright @ gdeepak.com
35
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
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
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
Copyright @ gdeepak.com
41
Graceful degradation
Another term for fault tolerance
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
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
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
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
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
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
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