forked from Varadraj75/Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintroduction_to_dsa.txt
More file actions
33 lines (23 loc) · 1.07 KB
/
introduction_to_dsa.txt
File metadata and controls
33 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Introduction to DSA
DSA tells us the way to organise or storing or retiving the data in the efficient way/
1. Array
2. String
3. Linked List
4. Stack
5. Queue
6. Tree
7. Graph
Time complexity:- BIG O notation O() (o is capital ) and () is for the realtion
it is relation between input size and the time taken by the program to run the code.
it says how number of input varies the time taken by the program.
1. Constant time complexity O(1):- number of input doesn't depend on execusion time , always the work remain same , always realtion between the input and output remains same
for example:- program:-
n=int("Enter the input")
print(n)
these is O(1) notation
2. Linear time complexity O(n):-
we have to go to each any every element one time in the iteration , visit everyone
3. Quadratic time complexity O(n^2):
each and every element has to visit other element
4. logarthmic time complexity O(log n):
square root >>constant >> logarthmic >> linear >> Quadratic >> cubic