Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: Easy DSA Notes
Description: You will identify Why we write Algorithm? Who writes Algorithm? When Algorithms are written? this notes are sufficient for beginners also.
Description: You will identify Why we write Algorithm? Who writes Algorithm? When Algorithms are written? this notes are sufficient for beginners also.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
1
...
The importance of the subject is that apart from theoretical examination
it is also important for competitive exams and even programming contests most of them are
designed from this subject
...
Algorithm
is written at design time and when the programs are done they are internet implementation
time the design time an implementation time
...
The one who understands the problem and has
the domain
...
University graduates mostly Union City graduate knows at least C language
...
Algorithm is mostly in the name of algorithm we write C language program
only so the benefit is that everybody knows C language now
...
1 Priori Analysis and Posteriori Testing
Pre-analysis means we will do the analysis of an important by studying it into greater detail
knowing how it is working and we get some results that is rate of analysis there
...
1
...
The
next output algorithm must generate at least one output otherwise it 's no use of writing a
quarter it must generate some result
...
Chemistry experiment
done by the students in the laboratory gives a procedure and physics experiment done in the
lab is also procedure
...
1
...
Algorithm should be time efficient
means it must be faster and faster so after reading the algorithms we analyze how much
time it is taking so that time what we get is in the form of a function
...
algorithms are analyzed and furthermore if you have any other criteria criteria
...
Data transferred or network consumption is also important criteria
how much data is going to be transferred see if the algorithm or means if a procedure that
you are writing if it 's unnecessary transferring to larger size data
...
The analysis is at basic level but at a
very shallow level this base analysis we will do will not go into much detail but much detail
analysis can to be done next just space analysis what are the variables used here for a
space and rent
...
planning it converted to a program it may have been a program
...
1
...
Alberto did some
algorithms and find out how this method is useful for five to ten complexity of algorithms
this algorithm is for finding sum of all the elements in an
...
Whatever is there
inside this loop will is u4 n times this is and two legs are two statements are they each is
taking and then what is this again the Zulu
...
Next algorithm
is multiplication of two matrices you can see that there are three loops nested one inside
one one inside another let us find out the time on this side
...
5
...
this will be 4 2 times and when I is the 3 J will take 0 1 2 & 3
...
4 goes on how many times it "s going to execute it 's going on K times so what this will
be 1 plus 2 Plus 3 plus 4 plus goes on to K time
...
5
...
K that will be equal to n so K is how
much log in these two so the other we have analyzed this one
...
If a rent of n value at
10 let us see what happens is initially 1 1 is less than 10 now n value is at 10 once less then
10 continued its multiplied by 2 so 2 is left then four four is less then eight multiplied with it
is 8 8 is also connected then 16
...
The previous one in the first example I have shown you that it
was multiplying time and starting for a month now this is dividing every time starting from N
and and up - what up - 1 it is reaching so it 's part of login makes these fullest
...
Order of n is order of n and whatever is they recite will repeat for and times next the in the
follow this is using j j j is less than n and j is every time x 2 right so this is a friend a login
time and anything inside that also will take login time if remember initially I've shown you
that this is mistakes n plus 1
...
1
...
3 Time Complexity of While and if #3
In C language there are three loops while and do-while there is a difference though while will
execute minimum one time but follow fine while loop
...
in old
languages they used to be a loop called repeat some statement inside and under some
condition now these loops were different repeat until loops are different this will repeat as
long as a condition is false and once the condition is true it will stop so it is similar to do
while how minimum one time the statement is but it is different compared to Dubai
...
saying that it was 2 n
...
interested in
the degree of a function so we say order of n now that 's it now you can see whatever I can
write using while loop I can
...
In so for loop just you can
reframe them as while loop let us take one more example again a loop is there while loop
and in this while loop I is starting from N and I is dickweed getting divided by two every time
so again the time will be log
...
can see
that is some off and natural numbers so this will be M into M plus 1 by 2 roughly plus 1 it's
strong roughly it is this much now this is K value will be this much
...
If there
are so I can say that if there are
...
There is no minimum or maximum there is no best case or worst case if n is greater than 5 it
will execute that 's all' so as I said that you can not take it as a rule that if conditional
statement if s there the time will be different all right
...
6 Classes of functions
The time complexity of any function that veneers Cortana 's 2 then this constant if it is 5 then
also its constant
...
equal to 500 and plus 700 then also a squatter of n
...
1
...
n square or Laura 's Locker is less than
root n as well as and naturally it's less than all of them so n poetry that goes on in port 4 or 5
or up 200 also that is less
...
less than T for him
...
1
...
1 Asymptotic Notations Big Oh - Omega - Theta #1
Asymptotic notation is used for representing the simple form of a function
...
function and teton location
...
Travis says he has to take care this function is having two terms so I should not write
multiple terms I should try to only a single term
...
F of n is Big O of M G or furnace and so F of
...
F often actually belongs to this class it belongs to the state function this
one it means all those functions which are greater than or equal to this one including this
this becomes global warming and what this exactly becomes this becomes average power
average bomb
...
F of n is omega of log n or root n log n
...
I can already use any value other than this one
...
A termination is average notation so here I can use only n I can not use any
other rather and this is mostly recommended whenever you have any function and if you are
able to represent it annotation that 's better but it 's not possible and you can go forward
people or Omega and one going correcting do n't mix this done but best case or worse kiss
or forgotten
...
8
...
If a fortune is n Square log n + n then n
...
Lower bound for n factorial is n power n so upper bound is n fallen and a lower
bound is 1 so this is the function for which you can not find the theta
...
Theta is preferable if you are
able to find theta for any function that 's better because that is a time bomb
...
Mustang so hope you have understood this topic this is very very important topic now I 'm
coming leader at its next video you can find the properties of asymptotic notations you can
watch that video
...
Meaning
...
9 Properties of Asymptotic Notations
If a fourth and else Big O of G of n then a into F of n is also big o of G of n this means
example F of N is 2 n square plus 5 for example
...
n is Big
...
of M will be 7 into 2 n squared plus 5 49 square plus 35 49 square
...
There is a
form when Buddha functions are seen then they are symmetric one state of another and that
$ 3
...
Transitive property satisfies on asymptotic notation for all three notations I am showing
only one notation that is Big O
...
Product of these notations G of n into e of n will
be equal to Big O of G of N into G of M
...
10
...
to compare functions so I will write few functions and let us compare them
...
Now I will confuse so if you are unable to just which
one is greater than this one we know n square is greater
...
I have not applied logon with
the SEC but I have used the formula of log for something that even you have a logo so you
can get something
...
10
...
If you are unable to judge it still you can apply long
directly write down and if I apply log then this will become 2 log of log n and this becomes
log n into log in so that our game decides for that slogan
...
G 1 is equal to 0 here g -- -men was greater than 0 but beyond 10,000 beyond
10000
...
If
you open this it will be n power n that is going to be a higher strong it is just like for example
n plus 3 whole square then what is the highest at all you get there n square is not yet strong
...
11 Best Worst and Average Case Analysis
in this video we 'll learn about best worst and average case analysis of algorithm so for
example I 'll be taking two algorithms that is linear search and binary search tree I did two
examples linear search
...
and it will be go on checking all the elements until either it finds an element
yes the element is found so here is an element
...
Worst case for enemy menses and and that is
water of M so here I write bullski is for n elements is order of n so now I have skills as well as
worst-case times given for linear search
...
Algorithm is based on number of comparisons how many comparisons are
required for finding an element right so my I have best case and it 's time and the worst case
...
Best case is seen for my research the basic is the same
searching for that one then what is lower scale is searching for a leaf
...
Mongoose is time as how much
login and maximum was his time is how much
...
1
...
The
famous algorithm that uses disjoint set is kruskal's algorithm which detects cycle in a graph
...
The time efficient operations are weighted Union and collapsing find that are based on the
ranks
...
If they belong to different sets then perform union of those two sets
...
There are eight
vertices I have taken a Universal set with a two vertices each element you considered it as a
set now let us start what we 'll be doing is we "ll be going on taking edges including edges
and forming the set so for them one by one so the first edge is 1 comma 2
...
The mix edge after the 4th edge this is the 5th edge I am going to
take
...
These are at two different sets so you remember we
perform Union how to perform Union so we will select one as a and two as a child here and it
's a child as a three and four so we made the parent of one said as a
...
Using now I 'll show you the graphical
representation as well as irony presentation presentation c4 representing a set
...
Each is having value minus 1 means each vertices is in its own center next to show
you graphically how it looks like I have even taken these eight nodes
...
Let five come as a child of one so at five we write one now - the rules
are added to this so 4 and that - 2 is added
...
Collapse of a set is called as collapsing fine but collapsing find we can
reduce the time for finding the same value next time next time first time you may omit
spending some extra time but next time in constant time we can get the parent now
...
Binary Search Iterative Method
binary search is a searching technique surrounding a method for such there are two different
methods one is a linear search in the second one is binary search
...
The risk list is narrowing down to a smaller list of just three elements for a 15 we
have started now we are left with only three elements
...
The number of
comparisons seems to be less than linear search now let 's search for any element which is
not present in the list and let us see what binary search it does I am taking and key element
30 it 's not present here after 29 we have 31 so 30 is not there here so let us trace this one
this is low it is 1 and this is high
...
It returns the index of a element found so instead
of algorithm I am writing it like a function then low is at one and high will be at n I 'm not
declaring them Ln and H are the variables integer variables
...
If I am
searching for an element 47 then it will first check at 8 and if the element is not 47 it is
greater so it will look on this side that is 9 to 15 and the middle of that one is 47
...
The time taken by binary searches login
so from the tree we can analyze and one more thing if I am searching for any element if I 'm
searching for an element which is not present then what happens suppose I'm searching for
a 65 then first it will go here mid ate then on 12 then on 14 then on 15 then it will try to go
that side but the element is not there so it will stop on this side
...
...
If there are multiple
lists then we can merge them in different patterns we have seen that
...
A single array can have many number of lists
let us see how it works
...
The algorithm is similar to two way merge sort but as it is recursion we
need some another name so we call it as more sort let us see the time taken by mass sort
...
Low and high
are taken low and high so low is less than high this is low and this is high
...
this side is completed so what is the next step March so these two are
merge so this becomes what first 3 then 5 then 7 then 9
...
When n is greater than 1 what it is doing when n is equals to 1 it 's not doing anything
so we do n't write 0 we can write 1 or some constant
...
The total weight should
be less than or equal to equal to 15 kg this is a constraint
...
I'll write down here X values so here I will be writing X 1 or X 2 or X 3 right X values
I'll be writing so this x value can be either 0 to 1 this X can be from 0- 1 so it means I can also
take fractions yes so now listen one thing very carefully this knapsack problem is for those
objects which are divisible The greedy method says that first you decide how you are going
to select the input then go on selecting the input 1 megohm
...
I have a solution for this problem and this is the solution this shows how I am going to
include objects which objects I should include so that I get the maximum profit now I have to
calculate the profit and find out how much it is I have just written here the values from 0 to 1
now I will see total how much profit I get and I will also verify the weight
...
I 'll be making videos for all of the topics that are in greedy
...
Title: Easy DSA Notes
Description: You will identify Why we write Algorithm? Who writes Algorithm? When Algorithms are written? this notes are sufficient for beginners also.
Description: You will identify Why we write Algorithm? Who writes Algorithm? When Algorithms are written? this notes are sufficient for beginners also.