 So, let us look at, let us look at model college, which is an advantageous way to represent graphs and memory. Can you hear me? Can you hear me? Yeah. So, which is an advantageous way to represent graphs and memory is the question. Can you hear me? Can you hear the question? Which is an advantageous way to represent graphs in memory? Can you hear my question? Can the moderator respond? This is group chat, no? Yes, group chat, but the one that colleges don't want to... Oh, ability to do that. RGCAT, can you tell me whether you can hear me? He is muted in the next video. Okay. Can you hear me? Okay. MIT, can you hear me? Can you hear me? Yes, ma'am. You can hear what I am saying, right? Yes. Okay. Model college of engineering. Okay. I am just going through some questions here, which is an advantageous way to represent graphs and memory. There are two types of representations of graphs. One is using the matrix representation where you have a two-dimensional array or you could use a adjacency list representation. Adjacency list is... It depends upon what your application is. If you want to have random access to the vertices of a graph, then a matrix representation is better. Whereas if you're looking at something like Dijkstra's algorithm being run to find the shortest path, for example, an adjacency list may be a better representation. So there is nothing like the kind of representation at least with respect to graphs depends upon the problem that you're working with. Okay. If you're perhaps looking at coloring problem for that matter, an adjacency list representation may be very good to solve the coloring problem. But if I'm looking at... I want to find out from which node to which node I have a connection. Then instead of... If you're using an adjacency list representation, I have to go through the array severely. Whereas if I use an adjacency matrix representation and if I have a way of indexing a particular node directly, then random access is possible. So it depends upon the particular problem whether you use adjacency list or adjacency matrix. If your matrix is quite dense in the sense that you have a large number of edges in the matrix, then adjacency matrix representation is better. If the number of edges are very small in the given graph, then adjacency list is generally proper. Okay. Did you get my answer? Fine. All right. The next question that was asked was what is the practical usage of different data structures? There are a number of applications. See, the most important point about data structures is that especially the abstract data type variety which was talked to you in class is primary that for example, if you look at today C++ C and so on or even Python for that matter, I have what are called static template libraries. Okay. And here, for example, something is already implemented for you if you want to. For example, if I'm looking at recursion, you can't do without a stack. If I have very large strings that need to be represented, the queue is a mandatory to be represented. A binary search tree for that matter is extremely useful for representing dictionaries or variant circuit like the B tree for that matter are also used for representing dictionaries. B trees are used even for disk accesses. When you're talking about binary search tree and all that, everything is sitting in the memory. Whereas when you're looking at a B tree, for example, all the data is sitting on the disk and it gives you a very fast way of accessing data that is residing on the disk. There cannot be a question about data structures today for the simple reason that let me give you a very simple example again. If you have a particular data structure and you because of the way of implementing the data structure, if you've got a time complexity, one case of order n and another case you've got order n squared because it's poor implementation. Today, especially in the context of big data and other things, you have millions of records. So this n squared becomes very, very large in that particular context and you'll actually see that, especially when you're working with machine learning and other things, when you're looking at algorithms with train, for example, train the model. Sometimes you will find that a program which takes 10 days can perhaps be done in one day. That's the kind of benefit that you can get if you implement good storage structures to solve problems. And what should be the preferred language when you're looking at real-time implementation? I would advise that the next question that was asked, I would advise that you use C or C++ because they are the fastest to give you some numbers. If you write a program in C to access an array and you write the same program to access an array in C++, access the array in Java or Python or Perl for that matter, you'll find that C is the fastest. So it's very, very close to the machine. At the same time, it is a higher-level language. Normally, real-time implementations use C as the programming language. But C, of course, the difficulty is it's not very easy to implement. You do a lot of carefully programming for that matter. And there was another question. If a graph is directed, then how do you traverse the bread-first-search graph? It's not a problem. All that you have to do is put your forward arrays, forward arcs with one and reverse arcs, you set it to zero. And you traverse along the forward arcs. So just like how you would search in a, like in depth-first-search, you go on the forward arc. The two examples we took, depth-first-search using directed graph and depth-first-search using undirected graph just to give you two different examples of the problems. That's all. It's the same way that you process an array. How to multiply, the next question was how to multiply two polynomials? The best way to do this is you represent the coefficient of all of them. Yeah, can you hear me? Back in area. RGC, please respond. Your question is... Wait, please. I must... Please switch off your mobile phones. Your mobile phone is just placed in your mobile phone. In the application. Please wait. We need to enable it. We need to enable it. Microphone has been enabled. RGC, your microphone is enabled. Yes, yes. The number video connected. See what they do. So let me use the writing. How do I read this one? Okay. So let us see the question was... Yeah. I'll just go... One moment, one moment. One moment. One moment, one moment. Please. Colleges, Colleges, I'm putting your microphones. Please don't make noise. Colleges, please don't make noise. Pay attention to the screen. If you want to ask a question, come close to the laptop or the microphone and ask a question. Or raise your hands and I'll... I'll come to you again. I'm just going to write the questions. Okay? Advantage, tedious way to represent graphs, to representations, matrix, edge matrix, edge list, another very next year. Depends on the problem. Yes. Next question. Basically, if you're looking at a good data structure for implementation, if you use a good data structure and if you organize the data properly, for example, linear search would cost you this much. Whereas you're organized, for example, in sorted order, then the binary search would yield you a much better search time. Okay? And next question. Preferred language. Real time. I would say see. But next question. Smallest question. Three. Question four. Implementation of screen using an array. Okay? If you always implement a heap using an array, that's the most beneficial. The next question. File. Directed. Form. AFS. Let's say I have something like this. You follow, basically, you try to travel as widely as possible. So starting from the node A, I'll go to B first and then to F. Put these two in the queue, okay? Then you start with B and go to C. And C and D will go into the queue. And you go through the same process. Basically, follow the algorithm with forward arms. Properties, nodes in the queue. When you have exhausted, node is exhausted. It's not very different. How to multiply two polynomials? Let's say I have, let's say we had two polynomials like this. Let me call this P of X. And let me call this Q of X. You want to multiply P of X into Q of X. Okay? What is the maximum degree that the elements can have? Because it can have. So basically, when you're looking at this, this is basically A n X n A n minus 1. So up to B. So if you look at least two polynomials, which I want to multiply, the maximum degree that P, that can be in the product, let me call it R of X. This is equal to, let's say, R of X. Maximum degree is what now? It will be A n into B n into X n into X n, right? This will be the largest degree. That means what? The degree of the polynomial is going to be n plus n, okay? And what is the smallest degree? You have A naught plus A naught into B naught. Therefore, that means degree is X to the power of 0, which is equal to, that is the smallest degree. So now, what you need to do when you're multiplying two arrays, when you're multiplying two polynomials, store P of X in, let's say, an array A going from A0 to or up to the nth degree. Q of X is stored in D0 to Dn. R of X goes from R of, let's say, let me call it C of 0. And what is the maximum degree? C of n plus n, okay? So compute this product. It's very simple. And what are we looking at? We have, so basically, if you look at the way this works, let's take an example, okay? Let us say I have X squared plus 2 X plus 1, multiply it by, let me say X minus 1. Let's say this is P of X. I'll say A of 0 is equal to 1. Store the coefficients in the array. A of 1 equal to 2 and A of 2 equal to 2. Okay? Similarly, you store B of 0 equal to minus 1 and B of 1. Take the product. What are all the polynomials that I've got? What do you have here now? You have, let me just multiply this, okay? Actually, I have X cubed. See, C is that the polynomials of degree 3. So I have to add all of these together. X cubed plus 2 X. Now, how can we do this programming? Okay? So what I do is, if I define an array C, 0 to n plus n, set it equal to initialize them to initialize to 0. Clearly, if you look at the previous thing here, now notice that this is A0 this is A1 and this is A2 and this is B1 B0. So if you look at it here, B1 is multiplied with B2 and what happens? The degree of the, that term is what now? 2 plus 1. Okay? So that becomes X cubed. Okay? Similarly, this one here, A1 is multiplied with B1, which gives me 2 X squared. Okay? So degree of the polynomial becomes the sum of the indices of the arrays A and B. Okay? So similarly here, if you see 1, this is of degree 1, degree 0 and this is of degree 1 here and I multiply X with this, which will give me this term, X1 plus 0 is equal to 1. Okay? So this is precisely what you do. Similarly for the next one, if you see what's happening now, if I look at minus 1, multiplied with X squared, this will be minus X squared. So what's happening now? This is of degree 0, this is of degree 2 and therefore the sum of the 2 degrees, 2 plus 0 is 2 and that's why you get this minus X squared. Where should this be accumulated? So let's look at this particular problem. So I have here C of 0 equal to 0 initially. C of 1 is the maximum degree that's possible, 0 and so on and we are having the maximum degree of 3, right? C of 0 up to C of 3 is equal to 0. This is what I initially expressed. Then, what are we looking at? Basically, if you notice the problem here, every term of A is multiplied with every term of B. So that means what I have 2 loops. One loop going through the area, another loop going through the area and let's see how it works. So I will just have a simple statement like this assuming that M is the size of the A and for J, I need to do a C of I plus 0 is equal to 0. So what's happening here? I am multiplying the coefficient of P polynomial P of X, which is stored in the area at the I of X and that is multiplied with the polynomial Q of X whose the BJ corresponds to the J corresponds to the to the, to go back to this particular problem. What is it that we are storing? If you notice here, so this is stored in A2, A1, A0. That means what am I storing in A2? I am storing 1 here, I am storing 2 here and I am storing similarly I am storing B of 1 is 1 and this one is minus 1. So what we are doing is notice that corresponding to the location corresponding to the degree of the term we have a particular index corresponding. And we store at that particular index in the area the coefficient of that particular degree. Now if you notice here, when we multiplied X squared plus 2 X A of 2 got multiplied with B1. To give you a degree of X cubed right? So that was have to be stored in C of 3 and that is precisely what we are doing. C of i plus 3 is equal to C of i plus 3 plus A of i plus so i and j are the coefficients of the two polynomials. A of i corresponds to the i th coefficient in polynomial and what is the i th coefficient represent? It represents that term with a particular degree of X. Similarly, we add a B at the jth index contains the particular term with an degree of G and this is all there is to this polynomial multiplication. Are there any questions? Are there any questions from anybody? Colleges I have unmuted Colleges I have unmuted Please go ahead You can ask your questions Please sit down properly and go to your laptop or your desktop microphone and speak to microphone Hello MIT MIT minutes properly MIT minute I have not heard your voice What is the question? I cannot show you Who wants to ask question? Siddhartha One moment Siddhartha, please go ahead Yes sir What are the best algorithms for writing the permutation and permutation? Best algorithm What do you mean by best algorithm? I mean the best technique for writing the efficient technique for writing the permutation and permutation Tell me what is the problem Let us take NCR Let us say I have to compute NCR The formula for this is what factorial in by factorial N minus r into factorial r Now Can you tell me how will you compute this? I am asking you a question Suppose you have Let me give you a answer Suppose I have factorial N I have a fact of N which computes the factorial of N If I use this function to see any problem with this So clearly I can compute factorial of N by I can say fact of N by N minus r into fact of r What will happen with this? Suppose I give you fact of 500 Can you tell me? I will try running it with this I have a factorial function which computes the factorial of N So what I am doing is I am simply computing fact of N divided by fact of N minus r into fact of r Similarly if I am doing NPR What is NPR? NPR is equal to factorial N by factorial N minus r Suppose I did this What will happen? Have you tried running this on your computer? What happens? I have a fact function Remember this is What is factorial of N equal to? Factorial of N is Fact of N into fact of N into N into N minus 1 into N minus 2 and so on into 1 Correct? So can you tell me what will happen if I did this? on the computer? N into fact of N minus r Yeah doesn't matter N into fact of N minus r Whatever you want to do What will happen? My question to you is If I give large numbers Let's say even 25 What will happen? What will you do? Very quickly Saturate your space In terms of dumpers Okay, so you can't compute it Alright So what you do is You try to simplify NCR can be written as N minus 1 CR minus 1 into N minus 1 plus N minus 1 CR What's the advantage of this? You see any advantage See what is happening is Okay See what is interesting about this formula Versus Here If I look at this formula If I look at this formula And then I compare it With this formula We'll give you a result For large numbers I'm asking you a question Second one, very good Why so? Because it's continuously noticed that If you notice here What is the reason for this is primarily that If I did this computation For example And did the end factorial computation Then what's going to happen It will run out of the space of the numbers But here what it's doing is To smaller problems And solving each one of the smaller problems So what is interesting is that NCR Which into the Space of the number But because of the way you have performed The computation It does not suit you So always it is important for you Whether it is Oops Whether it is NPR, NCR for example Make sure that You have Found Always reduce the problem To something that is tractable And take out the support So for example if I'm looking at NPR It's easier than NCR All that you have to do is you only need to compute Not compute the numerator factorial And denominator factorial Simplify the problem And compute it So this is also quite a bit of Understanding Of whatever problem you are given To Don't think that computer science is simply about Programming and you are done No, you have to spend time On understanding the problem And working out the problem Then There was one more question that was asked So is this clear what we are doing here Basically the fundamental difference Is Writing on paper does not matter But when I am using a computer To solve the problem, I must realize That the computer Has what is called Finite space When you are writing it on paper The precision with which you can compute Anything is in finite But when I am writing it On the Using a computer to do it There is only a finite arithmetic That is possible So what you try to do is Within the finite arithmetic that is possible To develop algorithms Which make the Which will make the program more efficient Or solvable Within the space of the computer There are lots of such examples That you come up with in practice In fact, for example Let me see if I can Give you this Suppose I have To compute the sum of Let's say I want to take The sum of Oops Suppose I want to compute Madam, choose the pen on the top Madam Yeah, you have the pen But I think I did something to it It's not writing Tell me not to press Something he told me not to press I did not know what I should not press Sorry boys, I am girls Writing problem Madam Or should I choose Madam is coming What should I do So let us say I want to take the sum of V to the power of some 0.0 0.0 Plus T to the power of 0.0 What do you think will be the problem What will happen to this number Suppose I want to take exponential Now let us say I write a program What will I use I write e to the power of x Equals 1 plus x squared by 2 factorial And so on Let's say I take some hundred terms Do this approximation And when I take the sum of these Two numbers what will happen Can you tell me It's too small right So what will you have you will get Actually what you will get is If I take this But you know in many problems In machine learning and other things This is the probability values Will be like this very very small Then what you do is You take the algorithms Will say take log of this 1 divided by So 0.0 0.0 And Then You take it to the power Just do a subtraction Of the sum and all kinds of things To make sure Let's say this was minus here I am just giving you an example So when you divide these two What happens is these two numbers Get very close to each other Suppose this was minus 1 This is just to give you an example Then what you do is you take the log of this thing And then you When the ratio becomes small When you convert the sum To a Compute this I don't remember the details of the algorithm There are algorithms for all of this Notice that we take e to the power of this But what am I doing here I am taking e to the power of log of something some difference There is a formula which will tell you e to the power of log of a by b plus Don't remember the formula You can get this on the graph There are algorithms for all of this So this is something that you must remember Whenever for any problem You have to know your domain And that particular domain Find an appropriate algorithm You cannot do it Just see I program it as it is And things will work It will not work It is pretty well known That we cannot do Infinite precision arithmetic Know the precision of the arithmetic of your Problem Develop an algorithm One more Do you want anything I guess we are looking At my notes that I have I want to complete them So what you do for this log addition Is the following Let me just do this What you do is basically We are looking at log of x plus log of I want this Some also in some log of Let us Then what we do is We check if x is less than y Then We compute Whichever is the example If x is less than y Then you take difference of y minus x And then Compute z is equal to Exponential of the difference Which is what we can do This is the algorithm Then you write x of 1 plus z is the value Where you work Alright So this is the answer to This is the value of log z Then I take exponential of z I will get this sum of So what am I doing now Let us go back to the problem that we have I have exponential of Let us say x Exponential of y I convert this to log of x plus log of y Then I get log of z This is a formula Which is well established Available on the web You just precisely what I have Then this will give me If z is equal to x plus log of 1 plus z Then I take the e to the power Because this is log right This is giving me z here So this is log of z I take e to the power of z Once I take e to the power of z I have the sum of this Also in some form Is this clear What I am trying to do Do you understand what I am trying to do So this is how The problem that is given Please try to Simplified first mathematically See if I can compute Given the finite precision Arithmetic that is available On the computer And once it is available Then you go back and encode Because what we want to do is See we do not as far As possible we want to Exploit the precision That is available on the computer You do not want to go to double precision Because if you go to double precision What is happening If you are looking at a real number Which uses 2 words Double precision will make 4 sometimes 8 words So your memory reduces So you want to store as much as possible In the memory And also make meaningful computation So this is something that you must Keep track of With respect to the outcomes Is this clear Any other questions Let us look at the next question Yeah Yeah Tell me what questions Are there any other questions that you have I cannot hear you Siddhartha Please unmute Siddhartha I cannot hear you Can you hear me now I cannot hear you What I will do The next question was What is the simplest thing to do Is a recursion key I will show you how to do this So let us say I have n elements Let us say I want to perform binary search analysis The simplest thing that I will tell you Is the easiest way to do this Is use what is called a recursion tree So What am I doing now I am dividing this into 2 parts Of length Then again I am dividing Into 2 parts Of length 2 2 parts of length 2 And then finally I am dividing Into parts of length 2 Okay So now if you look at it What is it that we are doing Every time we are dividing the array Into 2 parts And we are only So let us say I want to check If number 16 is present In the array So first time what do I do I compared it with 17 here Because that is the middle of the array It is less than 17 So you go to the left of the array Now again what do I do Then what am I doing now I am dividing again into 2 parts Then I am looking at Only these 4 elements because 16 is less than 17 I am looking at 3, 8, 15 and 17 Again I divide this array into 2 parts Now what is it that we have It is greater than the middle value Therefore it has to be present in this part So now I compare Only I am looking at 15 and 17 Now again I divided Into 2 parts There is greater than 15 Then I check whether it is equal to the 7 and Or not, it is not You see the array is not present So how many comparisons did we make Initially we compared 1 here 1 comparison here 2 comparisons here Finally a 4th comparison So now Suppose the array became 16 sites Then what will happen I will just have 1 more Suppose the array was a size 16 Instead of Then that means suppose the array was size 16 Suppose the array was a size 16 Then what will happen Is it would have just Increased For example 1 to This I would have had 1 more comparison And the rest of it Again let us say I am looking at the number 16 So I would have divided into 2 parts again 8 elements each So what is So when you look at it for example Even though the Array became double the size I have only 1 more comparison So you can keep doing this If I look at 32 for example If the number of elements was 32 Then I would have 1 more comparison So basically When you start realizing that actually There is a relationship between This And it becomes log of n to the base 2 plus 1 Easy total number Of comparison Let us go back to this problem here What did we do here We had 8 elements So 8 is the total number of elements Then what did we do we divided into 2 parts Then you compared with 1 part Then again divided into 2 parts You compared with 1 part Again divided into 2 parts and compared with 1 So if you look at it here 1 comparison here Another comparison here Third comparison here 4th comparison Okay So when you look at it there are 8 elements But power is not there Power is not there Any other weird question answer Paniyacha No no The complexity and How you call We write it Select it So now this is what I just wanted to tell you Man that is Man Yeah a small request To Mr. Dan and Jean Sir now a new feature had come in that What's actually happening is If the speaker does not respond For a second or so The audio gets muted Again when you start speaking The audio fades So you understood what I was taking suppose If I am taking a class I say hello students Now let me explain What I have done now is I have formally written Can you hear me Yes ma'am So now if you notice I have given a form Of forming the same analysis So if I look at t of n Then we find that area is Divided by 2 T of n let's say is the complexity Of this Then what I will do is I can write t of n as equal to T of n by 2 because In binary search we are dividing the area by 2 Plus some constant We assume that multiplication Division addition Subtraction Some constant amount Okay Then this is the Recurrence equation Recurrence equation So the Recurrence equation says Initially the area size is n Then The cost of computing The time complexity of the algorithm Is equal to the cost Of computing the time complexity Of the algorithm Where the area size is divided by 2 Because I have made one comparison With the middle level And the comparison is going to cost you some c That's the meaning of this So let's take this example The cost Comparing with the middle level This is the cost Then we are making the area half That is the T of n Now T of n what are we doing We are again dividing the area by 2 And the complexity of the comparison With the element is what order is Next what we do We want to do The array of size 2 I am dividing into 2 parts Of size 1 And the comparison order 1 And then finally T of And it is only one element That I am comparing Therefore time complexity is ordering If I look at the total time here These are the 4 sums that I have taken This is order 1 This is how you compute Time complexity Now what we want to do is Because the array size is n We need to relate the total number Of comparisons that we have made The size of the array There are 2 kinds of size One is size of the input When you do complexity analysis This is based on the Size of the input And what is the size of the input here In binary search The size of the array Similarly Let me do one Suppose I am doing Sorting Let's take a simple example Of selections So let's say I have Selection sort The array of size n is being sorted Then what do I do in the sorting algorithm I am ignoring all the Variables Program won't come time For j going from i plus 1 What do we do Selection sort is essentially this What do I do? I start with this element I compare with All the elements Then what am I going to do I am going to move The smallest element to the beginning Of the array Then next what do I do I can't start from here So what do I have now Let's say I have 5, 4 and 6 Now again I compare this With all the elements 4 is smaller than 5 Therefore I will move here 4 and 5 5 and 6 are in the correct order So what I do is I first define Let's say this is the array of 5 A of 0 A of 1 A of 2 And A of 3 So what am I doing now I am setting There are online there So let's go back to this So what we do is We set the small element to A of 1 A is equal to i plus 1 j less than m I check if A of j Is less than Small Because less than small Then I initialize a variable called Long Which is equal to j So I just repeat this Can you hear me Can you hear me Once this is done At the end of this one Execution of this loop I am going to have the location of the Smallest element in the array Then next what I will do is I will simply Exchange A of i With A of long Let's look at this problem over here So I go through the I have the smallest element 5 Then I go from j equal to i Plus 1 to m Among these which is the smallest element 3 is the smallest element Where is its location at 1 Therefore j will give me the value of 1 Then what do I do I simply exchange The values of this So what am I going to do I am going to put 10 is equal to A of i A of i A of block A of block So that is the outer loop So notice I wanted to Let's look at the time complexity of this If I look at the time complexity of this i equal to 0 There is an assigned meter Cost is order 1 There is a test here This cost is constant Order 1 All constant time operations Are written as order 1 Then when I am looking At time complexity It is order 1, order 1, order 1 And what we are saying is This is like a sequence Of 3 programs and assigning The value of i I am comparing the value of i And I am incrementing the value of i Therefore this statement Is going to take max Of order 1 Comma, order 1, comma So what is that now They are not order 1 Therefore this takes order 1 Now here I am assigning This is also order 1 Here this assignment For example testing comparison This is also order 1 This comparison is also order 1 And this is also order 1 And Now exchanging In the outer loop That comes into the outer loop So this is in the previous loop Now if you look at it If you look at this comparison Over here this is order 1 This is order 1 This is order 1 There is again a sequence of steps Maximum of all of this is also order 1 But this is getting executed In times So we call this product of programs So what we are looking at is We have two situations A program segment can be made up of The sum of p1 plus p2 Or a program segment Is made up of p1 into p2 So this is called the sum rule In the sum rule We take max Of the time complexities of order Of p1 And Order of p2 Whatever order of the One We call this the sum rule When do we apply the product rule We apply the product rule We apply the product rule For example Here this is whole thing So you can apply the sum rule here Order 1, order 1, order 1 Because they are all one after the other Sum of two programs In sequence Therefore this whole thing This whole loop Execution of this loop is going to cost Order 1 But this loop is likely to be executed In times Of two programs So product of two programs If this has a time complexity Of order of f of n And this has A time complexity of Order of p2 has Order of g of n Then the time complexity Of Are you able to see the screen Colleges Time complexity of product of programs For example if p1 Ran in Order of f of n And p2 Ran in order of g of n Then one loop within the Other If I have for something And I have This p2 here and this is p1 here Then the time complexity Becomes order of f of n So this is called the product Rule p1 One program Within another program Because the for loop is one program And within the for loop you have another program You apply what is called The product So once you use these two rules Most of the things must be very clear There are Other kinds of time Complexity The size of the input sometimes For example when you are working with In number theory for example if you are looking At prime class 1643 for example When you look at time complexity You look at the number of digits In that is what Log of the To write this number for example How many positions to write If it is a four digit number The number is very large 1643 That is only four digits long So if you take the log of this This will be about four So we talk about in such a case The size as The log of 10 You can take base 2 or 10 doesn't matter Because it's only a constant that Distinguishes between the two of them So number theory problems Like factorial Prime classification These are all Beyond the scope of this particular course Time complexity for all these Is very very high Because When you are talking about The Value of N here The value of N can be very very large And notice that for When we talk about In terms of log complexity It should take how many Times you write with the pen The given number So that's because Beyond the scope of this particular course Madam, MIT has a question madam Okay, yes, please They sent us a message Saying when do we use Double pointer function Double pointer function W linked list What do you mean by double pointer Are you looking at something What do you mean By double pointer Are you looking at In star star A Can you please explain What the question is Or are you looking at A node with two links Forward Pointer and a backward pointer They are trying to speak But I think their microphone I don't know if they have a problem Please type in the message Please type the question Madam, they have typed the question I think you are able to see that What do you mean by function pointer here What is the func of Func 0 Is that a variable or what They are typing again And you have double pointers to the function Are you sure of this I see what you mean See basically saying that I have in star star Function of Some This is what you mean So can you tell me what this What is the meaning of the star star here Can you tell me what star star means there What is it returning It is returning a pointer To a two dimensional array Are you with me on this Are you with me on this Since your audio is not heard Please keep typing your messages This is a pointer Example Let me give you maybe Try to give you an example Int main This takes as argument Int Rgc Comma Cat Star star Rgb What is the meaning of this Can you tell me what is the meaning of that argument Which is being passed What this means is the following Have you Written C programs with command line Arguments If you have already written C programs With command line arguments What this means is let us say I am saying sort Let me write this back Suppose I am saying The program is sort Let's say I am running it in Linux That's large sort I am giving one argument Let me say A string here Which I am sorting Let me say A F I am parsing I am giving a file in which I want to write Let us say File dot So let's say this is what I want to sort So what am I giving Notice that this cat star Rgb means what This name of the program Is a string The argument to the program is another string And argument output From the program is also a string Therefore cat star star Rgb Consists of three elements First element corresponds to the name of the program Second element The first argument to program The third element which is also a string Corresponding to the third argument To the program So this Rgb means It is a set of Character strings So that's what I meant when I said It is a two dimensional Array Rgb of 0 In this example Is the variable sort Rgb Oops Bbf And Rgb Of 2 Is file dot Out So basically star star means A two dimensional array Are you with me on this Is this understood I think Are there any other questions that you have Colleges please Please raise your hand so that again Unmute your microphones please PPP Siddhartha do you have any question One moment PPP Siddhartha is just Unmute your microphones Please go ahead Siddhartha please go ahead No questions sir Okay Alright This should complexity analysis now Perform Siddhartha Rgb set whatever Rgb set I have seen you Waiting to ask a question You can raise your hand Unmute your microphones Are there any other questions Madam Rgb set seems to be Having a question one moment please Please go ahead I am pretty late sir What is the putting pattern for Data structures and programming I cannot give you this detail It will be very similar to Your assignments It is not going to be very different For the data structures part We will give you some kind of data structure Which is already implemented And using the abstract data type How to solve problems I think you already done the examples Of this kind on the assignments Okay Abstract data type based programming So something is designed and given to you Why is this so important This is the precursor for What is called object oriented programming What did you learn in object oriented programming In your courses you would have said Encapsulation Right Data hiding, polymorphism And all that stuff Most important thing is encapsulation What are you saying you have to hide everything Hide all the data What is the importance of something like this The implementation Of the data structures is hidden From the user of the program When you use static template libraries In C++ Or in Java you do not know how a vector Is implemented You use a vector Integer for example If I say int A Do I know how the integer Data type is implemented In C you will not know about it That is also object oriented And if you are looking at Let me give you an example again Do any of you have a question please I am not able to I am not able to go to the Sit at the speaker Into the microphone I think I have seen as a notepad here Notepad is gone How do I fix this One moment Notepad is gone I only have Google Chrome And Skype and other things One moment Notepad is gone What was I talking about I have lost that One moment I do not have the Earlier stuff to do that I seem to have What were we discussing some time back Are there any other questions I was talking about the use of Now I can share this Untitled notepad What did you do When it up something Notepad I did not get that Menu to write I will tell you I will not tell you I will tell you Ok Indus John What was I talking about I was talking about the importance of Object oriented patient Now let us say I give you 4 is equal to 4.5 plus 6 In one case In another case I say y is equal to 3 plus 6 If you notice here The same plus operation Works with this and also works with this So do you know how it is implemented You do not know how it is implemented Right So that is the whole purpose of Object orientation and ADTs Are a way of doing it There are standard Data types which are there Which is your integer Note bool and so on Whereas user defined Data types Are For example Stats queues what we learnt in class And so on trees Etc Now when you are looking at abstract Data types for example Now if you notice the static template libraries That you have in C++ And Java for example And they have a queue They have a vector Double ended queue And so on Data Many things are already available So they are also becoming part of the Basic data types And the whole purpose of abstract data types Is that you can define your own data types You can separate the Implementation And the definition The definition can give you what are called How you are going to communicate with the outside world And the Implementation You can choose whatever is best at that time That you know Then as you go along for example Initially maybe I wrote a very Inefficient algorithm Then as I went along I realized that I can do a much better Make a more efficient algorithm So you can do all kinds of things Of that kind When you are When you separate the Implementation And it is not going to go Yes madam Yes and we can close Okay fine Thank you very much