0% found this document useful (0 votes)
41 views2 pages

Week 1

Uploaded by

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

Week 1

Uploaded by

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

DHA SUFFA UNIVERSITY

Dept. of Computer Science


Fall 2024
Course Name: Data Structures and Algorithm
Week 1
Lecture Summary
1.Introduction to course
a. What is course about?
b. Goals of the course
2.Introduction to Data Structure
a. Different types of data structures (overview)
3.What is algorithm? Why we need an algorithm?
4.Writing an algorithm
a. Parts of algorithm
 Name of algorithm
 Parameters
 Pre-conditions are the necessary initial conditions of parameters to
ensure proper working of the algorithm
 Post conditions are the outcomes from the algorithm
 Body of algorithm
5.Algorithm analysis
a. Time and Space Complexity
b. Time Complexity Analysis using Steps Frequency Count (SFC) tables
c. Run Time Complexity (RTC) computed through SFC tables
d. Types of functions used in algorithm analysis
e. What is asymptotic run time complexity (ARTC)?
f. Difference between RTC and ARTC
g. Big notations
i. Best case (omega)
ii. Worse case (oh)
iii. Average case (theta)
h. Order of functions from fastest to slowest
6.Sample code snippets for ARTC analysis
i=1 O(1)
n=100 O(1)
loop (i <= n) O(n)
//code
i = i + 1 O(n)
end loop overall complexity
O(n)

i=1 O(1)
n=100 O(1)
loop (i <= n) O(n/2)
//… code
i = i + 2 O(n/2)
end loop overall complexity
O(n)

i=1 O(1)
n=100 O(1)
loop (i <= n) O(log2n)
//… code
i = i * 2 or O(logn)
i = i / 2 O(logn)
end loop overall complexity
O(log2n)

You might also like