module 1 introduction to ks
module 1 introduction to ks
MODULE 1
Prepared by,
Nasiya PM
Assistant Professor
Dept.of BCA
MES Asmabi College
P.Vemballur
DATASTRUCTURE
Creation
Selection
Update
Destroy
1.Non Primitive data structure
• That are composed of primitive data structure
Which are not readily available in programming
language
Classified as 2 (linear and non linear)
Linked lists:
Linked list is a collection of elements called nodes.Each
node contains two parts. they are data part and link part .
Traversing
Sorting
Merging
Searching
Insertion
Deletion
Complexity of Algorithm
Algorithm is step by step procedure to solve a problem.
1. Time Complexity
2. Space Complexity
Time complexity
solution:
f(n)=3n+2
f(n)=3n+2 ≤4n
if n=1,
3*1+2=6 ≤4*1(wrong)
if n=2,
3*2+2=8≤4*8(correct)
So for all n≥2, f(n) ≤c. g(n)
Hence, f(n)=O(g(n))
O(1)-means computing time is constant
O(n)- ’’ ” linear
O(n2)- ’’ ” quadratic
O(n3)- ’’ ” cubic
O(2n)- ’’ ” exponential.
LIMITATION OF BIG “OH” NOTATION