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: Data Structure Lab, SE Computer Engineering 2nd year
Description: 2nd year Data Structure Lab, SE Computer Engineering short notes made briefly focusing on the important points

Document Preview

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


Introduction | Data Structure Lab | SE Computer Engg | SPPU
Aledutron
The new series in which we will be discussing some questions from this cycle by fully pune
University
...
In this video
...
we would need a text editor to set up the things we would need in the next
video,
and then we can directly jump on to the questions
...
I am here at the
Linux mint home page so you can download the things and setup
...
The second thing is
the main home page for the sublime text software
...
If you
are getting some errors
...
what we can do is
...
So include iostream choosing namespace Http int main see out Hello
world then return 0
...
after selecting, you
can again use control B or tools and build so both would work fine so now why
to build and how this is all working so let 's just see the underlying process behind this thing
...
hexadecimal format
...
CPp file into an a dot out file
...
so what we are doing
...
So this all thing is
automatically done using this sublime text
...
This
works like this
...

So this is an package which you will be using for taking inputs directly in our sublime
...
If
you have not installed you will get an option to install the package control
So then you can click this and here you can put install so we have to install something so
package control install package
...
At last you will see new build system click on
that then clear all the constraints of this paste the thing which you have copied and
type the thing
...
We can again execute this thing while true and print zero so
we can execute this so here you can see this is going going on executing so to stop what
you can do is control plus break
...
we can use the shortcut
key to stop the execution so go to tools and click here cancel build so it will execute
...
Just used the basic setup and see how the things work so now We can directly
head on to the questions and discuss the questions
...

a video on that so that would be all for this introduction and setup video
...
a video of the question will be shown in the next video
...

write a Python program using functions to compute
...
number of students who play neither
cricket nor Minton and fourth number of students
...
in mathematics, it is called as intersection so basically
we have to find the intersection on these two sets so let 's see how we can do this
...
then we will go to next element and check whether it is
...

list called resultant, which will store the list of students who play both the things as we are
finding the intersection
...

So let 's just create an empty thing, then what we will do is
...
we can directly use the in operator or the membership operator to check
whether student is present in the second list or not
...

we have to remove 2, 3, 6 and 7 the intersection elements
...
we have to loop through each student in list L1 and then if student is not present,
then we will append this student to the main result thing
...
the question second list of student who either play 10 this 9
and 10 play badminton or cricket 145 but not both so these players not play both
the games so this
...
instead of copying the second
list, we are just create starting with an empty list
...
If that student is not present in L2, then we will append the
result
...
Let 's just execute yeah for a and we will set end equal to space
...

We are getting 2, 3, 6 7 B is 9, 10, one, four, five, nine and ten
...
we have to calculate same things or use the things which we have
calculated before so let 's just reduce the size and keep it so how would we do so either
what we can do is
...
The football
...


Cricket and fitball but not badminton, so what we can do is
...
So the players who play the football and then remove the
batman 10 players
...
Then we have to remove B
elements the elements from the set B
...
Now we are getting 8 and 12 same answer
...

Can now see the question is also printed automatically because we have used the docs
string so here is the question
...

You can modify this and play around with this and then the answer for this thing a b, c and d,
so let 's just put a new line here Now this looks fine
...
please email us at ireport
...


Question 2 | Group A | Data Structure Lab | SE Computer Engg | SPPU
Aledutron
We have to write a Python program to store marks scored in fundamental of data structure
by N students in the class write a function to compute the following first of all
average score of the class highest score
...
first of all
...
Instead of sum
...
We can directly use
the mark list
...
the average score of the class
...
What will happen If min underscore value is greater
than mark means what is happening We have set some minimum value
...

And we can use this simple single for loop so here just remove this command and put here
and then let 's just take this before this so if we keep this as it is what will happen
...
So they are called and used here, but they will not
find any reference
...
if mark is equal equal to none absent
student plus equals 1 means we are incrementing the value
...

Similarly absent student would be required to be declared before that so let 's just remove
this thing and declare here
...

we need a for loop again so for I
...

The question D they have set to display the marks with highest frequency
...
We first calculate the frequency, then for each key value in the frequency
...
For example,, 10 27 has a frequency 1 94 has 2, 20 has
4, 67, 1, 89, 1 and other all is one so like this, we can count the frequency
...
We can check if frequency of mark means we are accessing that element using
the key value
...
So like
this we will get highest frequency so let 's just print highest frequency
...

automatically
...

It considers this as a doc string so document string
...
We have n't added anything
...
display books in ascending order based on the cost of books
...
a function would take a name
and cost and depending on this
...
So this is same
as the list
...
so what we have
...
Our unique list would be
fine
...
if this book is in the unique list, we will not add
...
we have to inverse this thing so whenever
this thing returns true, the knot would inverse that value and it will create that false
...
So let 's just take some random numbers and this would be our books or the
cost of the books
...
We have to convert this element into this thing so what we can do
so Whenever I would have this list what I can do is
...
So here the minimum would
be one
...
instead of using this for
loop
...
will go one index ahead
...
3, then for 7, then for 1 and then for 4
...
the minimum value in this list is 1
...

Now is swap these two things
...
So swap we can directly
use the tuples unboxing to swap the things so what I can do is a of 0
...

Book list index out of range error error
...
index out of index error
...
index index index out out of number of elements
...

index out of the index error, So there ca n't be any index 7
...

we are looping on each of the elements of this list and going to each element
such as 2, 5, 3, 7, 1, and 4
...
directly checking with the mean value
so instead of checking with an index
...
Now we can see one two, three, four, five, seven,
...

We can say that list is sorted
...

Because after 7 there is no element present
...
We can index this and we can take the first element of this thing
...
So simply we have to add the
square bracket and one for each of the case
...
here we
basically check for the minimum element and put it at the first position
...
When we will discuss the main concept of sorting searching
...
To filter this according to some value I can directly
provide this value in this function and it should return me
...

Why because 300 400, 500 and this all elements so similarly
...

A class is used for creating a structure for the class book
...
to access the properties
...
This is a magic function given by the Python
...
It would take these two parameters name and cost and create an object
...
list so if I execute this here you can see main underscore underscore underscore
...
So here some address each
book has a unique address
...

instead of book list
...
return a list
...

So this is more readable as we are using object-oriented programming, but yeah so this
should work fine because we are printing the cost directly
...

This is the transaction lock for format D100 W200, so withdrawal is not allowed
...
Write a function for withdraw and deposit D means deposit while
W means withdraw
...
Then we have to take the input or else yeah, so
we will take input variable or what we can do is transaction lock So transaction lock equal to
input so we 'll directly take input from the console, and we will print a message
enter the transaction log transaction transaction log
...
What we can do is? We can store this entry in some
another variable, or we can put this into a list so let 's just create an entry list
...
on a new line
...

After the for loop completes we have to add the entry into entry list so entry list Eq not equal
to append so enter release dot dot dot append entry
...
We receive a comma
...
Let 's just give the 10 10 and again W10 so here now we can
see the same output which we have calculated using the for loop
...
After every comma we are going to get
a space
...
Add space as a deeliminator
...
that so as we can here see uh the list after splitting would have two elements
...
just
create a comment for now because we have n't created any deposit function
...

what we can do is if and only if the bank balance is greater than or equal to the amount then
we will reduce so bank underscore balance minus equals amount
...

the changes which we made here we changed the amount it was not reflecting in the original
bank balance so therefore it was having an issue so let 's just remove this
...

Question 8 | Group A | Data Structure Lab | SE Computer Engg | SPPU
Aledutron
A new question question number eight is to write a Python program that determines the
location of a saddle point of a matrix
...
I can store each smallest
value of row
...
there are n't any other saddle point
...
So let 's just take 4 and 9 so here the maximum was 3
...

Here maximum is 9 and in this row the minimum is 2
...
What will I do is calculate
the minimum value and insert it in that row minimum list
...
Should we check
for
column so what would have UH what would we have to do is basically
...
So now i will be the row count
...
So column underscore list equals empty list
...
of list
...
So I will create a column list where all the columns will be
stored
...
for i in let 's just implement a for loop and check
whether it is column common or not so for I in Roman list
...
for an m cross m matrix is said to have a saddle point
...

so first of
...
So we 'll print a message enter row
count and then he will enter that so column would also require the same so in input enter
column count
...
There means we are checking for columns
...
This would be all and we
will come with a new question in our next session
...

We will answer in the next session
...
This was the main program how to do this
...
So here we can give any elements
such as 1, 2, 3 4
...
This is one of the matrix and here
...
matrices can be of any
size
...
a single row can be stored as an
list so what we can do is
...
So in Python we
can call this as list in which this will be
...
would be 4 Comma 5
...
If I somehow
means if I somehow manages to traverse like this so first this element then this element
...
I can just go on adding this M1 plus m2s that index value
...

If you want to make this a bit UH useful and user friendly, then what we can do is
...
So let 's ask the row value so row equal to input
...

So input enter row value
...
If n is equal equal equal to 0
...
So here we don't know will m1 come or m2 come so what we can
do is
...
here we
should give
a colon and space so here what I will give is one, then two and three then again one two
three
...
I can look through each row at first just make it as
column in,
but how would I make so that I 's the question so let 's take the notation form so here I can
see we have to convert each row into column, but how we will do that so what is basically so
a simple thing
...
we will modify that so in transpose what we will do is
let's just

copy this thing only and we will modify it so yeah let me just paste this space transport copy
paste it here
...
multiplication in matrices is a bit complex
...
we have to consider the row of the first matrix and multiply it with the
column
...

Basically, how do we do this thing? So let 's just remove this at first and make some space
for some things and see
...
So here If I know these two are constant, so what I can do is
...

So let 's just say this is I and this is g
...
what I have to do is change this k depending on the number of uh columns so basically
Uh
...
for I in range
...
So first matrix we were using row, so we 'll use
the
row then for j it would be in column
...
I take the length so we would need the length
...
This is the row number so I can
directly take row so which are We can take the value so then what we can do is
...
I will take the answer matrix so first of all we
would need to also update that answer matrix
...
So why do we use plus equals Because first of all we store only this value 2 into 3 we
store into answer then what we do we plus
...
So like this we are doing
similarly, then four twos are eight eight eight plus this thing
...
It 's a
40 then again 4 into 3
...


Question 11 | Group B | Data Structure Lab | SE Computer Engg | SPPU
Aledutron
question number 11 states that we have to write a python program to store role numbers of a
student in an area who attended a training program random in random order
...
we would need a
student 's array in which we would store all the role numbers so let 's just create one i will
create
a student list and i will put the elements 10 40 45 45 67 89 34 56 78 73 90 1 and 37 so these
are the values i would take so as you can see these are in random order they are not sorted
so

basically we will see what is sorting
...
if index equal equal
equal to 1 means we can say student is not present
...
We require to check similarly, if we consider about
the maximum case what would be it, so it would be the first condition which we saw the
number does
N't exist
...
In this case do n't use the for
loop use
while loop so we will see this difference a bit later but for now just try to understand what this
internal search says so just remove the last element of the list and append some your key
...
If we are by using while loop we require condition that that condition
should be
...
both loops work same so here let 's just deeply analyze the how we how the for loop
works
...
at first,
I will be assigned to one so we will assign i equal to one
...

So again
...
Sorry
Title: Data Structure Lab, SE Computer Engineering 2nd year
Description: 2nd year Data Structure Lab, SE Computer Engineering short notes made briefly focusing on the important points