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.

My Basket

You have nothing in your shopping cart yet.

Title: DSA
Description: ..

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Lecture 4: Solving Pattern Questions (Part-2)
Love Babbar: We are going to solve 18 pattern questions in this video
...
We also did 2
pattern questions
...
This is the pattern
which we have to print now - Triangle pattern
...
Also
we can notice that number of stars in a particular row is equal to the row
number which is 'i' Now let 's take a variable count=1 and we will print this
count and then increment it outside this loop
...
Then after printing it inside col loop ,
we will keep on incrementing it by 1 There is an another method for this
question But first let 's write the code for this one We ca n't simply print
row and increment it , because then our program will misbehave
...

We have done 9 pattern questions
...
Next pattern looks like this 1st obs - row
= n 2nd obs- A is mapped to 1 , B is mapping to 2 and so on
...
We got our
counting correct but just had to map 1 to ' A ' so to do so , we added ' A 1 on both sides , so to
...
We just have to print ' A'+i -1 , but it will be
typecasted to integer so to avoid that
...
Bhaiya: We have to find a relation for printing
our answer
...
We can see their dependence on row number and col number
...
Also 'A ' will be there for
sure
...
So this is our formula
...
We just have to find the starting character
...
Do this one Now
let 's try out this variant
...
These
are very easy questions if you have understood previous questions
...
If you are able to do this one without my help, then it is very
good for you
...
I will tell it 's solution and then give you one more question to try
as your homework
...
In next one , we will see
operators , bitwise operators , For loop , and many more interesting
things
...
Also tell the answers in
comment section for the questions which I asked inbetween of the video
Title: DSA
Description: ..