Data Structures and Algorithms - L1
Data Structures and Algorithms - L1
F211) – L1
Algorithm 1: Algorithm 2:
Time
Space
3 7 9 17 5 2 21 18 33 4 Comparison Based
Bubble Sort
Quick Sort
Insertion Sort
Merge Sort
17 9 7 5 3 33 21 18 4 2 Heap Sort
Non-Comp Based
? Radix Sort
Bucket Sort
33 21 18 17 9 7 5 4 3 2
Data Structures
same name, c)
c[0] -45
c[1] 6
Array
c[2] 0
Linearly Ordered Set c[3] 72
c[4] 1543
c[5] -89
c[6] 0
node node
c[8] -3
c[9] 1
Data Next Data Next c[10] 6453
c[11] 78
Stack
Set with delete operation
specified (LIFO)
Queue
Remove Insert
(Dequeue) front rear (Enqueue)
Binary Tree
Heap
26
17 41
14 21 30 47
Red Black Tree
10 16 19 23 28 38
7 12 15 20 35 39
Skip List
Matrix Multiplication
Nearest Points
Efficient algorithm
to compute F(n)
Leonardo Fibonacci
1170-1250
19
BITS Pilani, Hyderabad Campus
P, NP, NP-Complete, NP Hard
Complexity Class P
Set of all decision problems (or languages) that can be solved in polynomial time
Complexity Class NP
Set of all decision problems (or languages) that can be verified by a polynomial-
time algorithm
NP NPC
NP-completeness
A language L is NP-complete if
L is in NP and
All other languages in NP are polynomially reducible to L P
Home city
Visit city
Millennium problems (US $1,000,000 per problem)
Hodge Conjecture
Navier-Stokes Equations
Is P = NP?
Poincaré Conjecture
Riemann Hypothesis
Yang-Mills Theory
8)
Q1 (1
8)
(1
5 )
Q2
(7
em
Co S
mp id
re ( M e st (60)
120 T
) Mid
La
Ev b C
alu on
La
ati tinu
b
)
on ou
t (30
Co
Tes (24)
(75 s
)
nt
Lab pre
st
Ev
ComTe
al
b
La
(75)
CS F 211 – L P U – 3 1 4
Team
Prof. N.L.BHANU MURTHY (Lecture)
Dr. Barsh Mitra (2 Tutorials + 1 Labs)
Dr. Odelu Vanga (1 Tutorial + 2 Labs)
Dr. Manjanna
Dr. Ramaswamy Venkatakrishnan
Ms.BSAS Rajita (1 Lab)
Ms.Priyanka Rishikesh Chaudhary
Ms. Sahithi T(TA)
Make-up Policy
No makeup for quizzes, lab assignments and lab test.
Make-up for other tests will be granted on prior permission and on justifiable grounds only.
Course Notices
All notices pertaining to this course will be displayed on the LTC Notice Board as well as
the CS & IS Notice Board.
Chamber Consultation
Thursday 1500 Hrs – 1600 Hrs
Jon Kleinberg and Eva Tardos. Algorithm Design. Pearson Education. (2007)