And in this case, the tree data structures are playing a pivotal role because there the access time can be reduced to order of log of n. So, then we talk about this taxonomy is that data structure can be of two types, primitive as well as non-primitive. So, primitive, I am not going in, so that could be integer, float, double, long, double, string, anything. anything and in case of non-primitive there are linear as well as non-linear so when i say data structure is linear then i'm particularly concerning that the axis of the element will follow a sequential pattern okay and element will be attached so first element will be attached with the next next will be attached with the third will be fourth and so on so there will be a sequential access from one side to other side and the one element appear after another so if you see array so in array the location is fixed let's say i have to declare an array of size 100 so 100 location will be reserved and we can store data sequentially okay and in case of linked list is also offer the dynamic nature key and at runtime we could increase or decrease the size of linked list as and when required. So that characteristics make it dynamic, otherwise it is static. Then in case of non-linear or a hierarchical organization, if you see this entire structure, it is forming a hierarchy. So this type of arrangement you will witness in tree as well as in graph. And a single difference that differentiate this tree and graph is that the formation of a boundary or a closed loop. If there is, then it is a graph otherwise it is a tree. So, we can say that tree is a subset of graph with the condition that there is no close, boundary or loose. That is not present in the graph. Then we have discussed about two important data structures. Basically, these are also known as derived data structure. They are derived data structure. So, that is stack and queue. Stack and queue are derived data structure having some specific property like LIFO and PFO. Last in first out and first in first out. So these were the discussions made in the last. So already we have talked about the array. So array could be 1D, 2D, 3D, 4D as per our requirement. And then we talk about the link list where we are storing the value in form of information and address link. So, if a node in the linked list is there, so there will be some value or information or data and this will be a link or address to the next node. So, in this first I will access this, then this, then this and then this. And how we know which node is first node? So, there will be a specific pointer that points towards the first place okay or the first node and last node will always hold an address that points to the null. Null means that there is no further value. So, this is the how we can check a linked list is. Then hierarchical arrangement tree and graph already we have discussed. So, this these two things if you can check just look like okay. So, probably we will cover after some classes stream grid detail. And then stack and queue as I have mentioned that that one follow the last in first out other follow the first in first out. Then we talk about the core operation or in algo in while studying different algorithms. What we will do? Algorithms we will discuss only on these four things okay traversal traversal means that let's say there are 100 students in the class if i say traverse these students so a person will go to all the students let's say they write their name or write down their role number and come back so visiting all the nodes exactly once and when i do search so there i am visiting the node but i am searching whether it is equal to certain key or not if key font we stop our search okay then we will emphasize on insertion and then last option is deletion so these four operations we will primarily perform while defining an algorithm or basically while while designing any algorithm on we will emphasize on these four aspects if these four operations are faster then that organization or that logical arrangement is more suitable for us. So, then we talk about the how these two data structures are different, that is linear as well as non-linear. And that concludes the last lecture. So, this was just a revision. Now, let us begin. Now, let us talk about the thing. I am planning a journey from patna to delhi okay basically usually what we do in the google map we see so it's so number of path okay and from where from one path we are and from multiple paths we are choosing one okay so now i am planning a journey from patna to delhi okay so now i have to write down an algorithm okay that will make sure that i will reach from patna to delhi via car if i am saying or any mode of transportation you can say drain you can say flight okay that I am taking now why I am taking this so there are number of things okay let's say when you are going by flight so that is one path from Patna airport you will go to the Delhi airport take care from from IIT partner to partner and take care from um delhi airport igi to some specific location okay where we have targeted earlier then from train also there are number of possibilities so you can go with number of trains okay and depending upon the costing in train also there are number of classes and categories okay now if you talk about the car journey okay if you talk about the car journey okay then that will be more interesting okay flight and trains are not you can say they are having a pre-specified path a schedule and everything but in case of car there are number of possibilities okay now i am planning a journey from partner to delhi okay then then one thing is that now i am going via car so i will think about number of factors okay first one is the time which path i choose such that the you can the time will be lesser or when just i'm picking here resource constraint so that is time okay now someone is saying i will not use the toll roads okay i will not use the toll roads because they are charging high like Purwanchal expressway, then Lucknow, Agra expressway, then Agra to Delhi, the Noida expressway. So number of ways are there. So from Patna I will first reaches to the Purwanchal expressway, then I will choose Lucknow, Agra expressway, then I will choose Agra, Noida expressway. So what basically we are doing, we are following different, different expressway, but they have a tolls. So, every time you have to pay toll on this. So, now I am thinking that I will not pay any toll. So, I will use state highways, state highways. But here in cost of toll you are getting what? Lesser time. So, one aspect is that the resource on which we are looking. So, first factor that is the resource constraint whether your resource is time or whether your resource is money. So, whatever the resource you try to take, whether it is a time or money. So, one factor comes. So, while designing an algorithm, we have considered a factor that is a resource constant and resource I am emphasizing primarily on time and money. Second thing is that numerous waypoint. Numerous waypoint means that waypoint is nothing but the intermediate stoppage or the intermediate location we wish to visit. So for example, when I am leaving from Patna, so let us say I wish to visit Varansi, Prayagraj, then Kanpur. So I plan to also visit Varansi, then Prayagraj, then I want to visit Kanpur. So that factor will also come into the picture. So let us say I do not want to visit these cities, so I will take a path. If I want to visit one of the city, i will go there and and take the path so there will be a uh you can say uh selection of numerous waypoint there are some person who had some favorite thing like some some uh some hotels or some bus where they will surely visits so that will also treat it as a waypoint okay then other factor will also come into the picture that is subjectivity human biasness human biasness means that let's say i want to eat from some air tree okay and i want to stay in some comfortable hotel during the bath okay i want to go to some specific place uh let's say temple or some workshop place okay so that things are there so what are the things uh why we are discussing on this journey from Patna to Delhi because when you design an algorithm now you are asked to make an algorithm that all the users who whoever wish okay whoever wish can plan a journey from Delhi to Patna on their you can say their conditions okay so their condition may be a resource constraint their condition may be the the specific way point their condition may be there's some human badness that they will not drive in night or they will not drive in morning. So, number of things will come into the picture. Okay. Now, just I will add one more slide, a blank slide, then we will discuss. Okay. So, now I am making an algorithm that should consider three factors. That one is resource, time, money, petrol, everything. So, in time and money, of course, there will be a petrol. So, if you are using expressly, so might be you are using more petrol or less petrol that is then waypoint, then some human factor you can see. Now, let us say if I provide I want to go from Patna to Delhi. Just source and destination I am giving. Then also your algorithm will produce an output that is relevant for me. When I provide source, destination, resource, I should use lesser time. Then also it is providing output. When I provide source, destination, resource, waypoint. Let's say I want to stay in Varanxi for a night, then also it is producing output. So, what this means that the algorithm is a generic and even it works well for partial set of input. So, algorithm will work for subset of input. And if you remember the burger making thing so what is it will not work for subset of input that is the you can say good thing about the algorithm that it will work even for a set you can say subset or a for example when we want to sort a number so we had make an algorithm that can sort a number so even we provide 100 number even we provide 10 number even we provide 20 number even we provide a 10 000 number the algorithm is working fine so this is the difference between making burger and and and and saying it is an algorithm because making burger could be feasible when it has a fixed set of input and algorithm says that the input could be the input could be input could be variable the input could be variable Okay. The input could be variable. Okay. Okay. Just taking a break for a minute. I am coming back then I will take the queries of you. Okay. Again starting. So, let me conclude then I will take the query. So, we have created an algorithm that is applicable or that is true for a subset of input. That is true for a subset of input and this thing was not feasible when we are saying that making burger. And even we are not just supplying source and destination, it will give you a specific path I should follow via car and then I will reach to the Delhi in this much time. When I provide a specific resource constraint, then it is working. When I am providing different waypoint, then it is working. So now when you develop this algorithm, then that is acceptable and it is true for all sets of input. So, similarly, let me do for another 5 minute on 8.30, I will take the queries for some time then we will proceed. So, if I go with an another definition, so what it says, an algorithm is any well-defined computational procedure that takes some input value or set of values that is important here if you can take some input value or set of values as input and produce some value or set of value as an output in finite amount of time this we will talk about when we talk about p and np problem okay okay so there we will talk about what is finite amount of time and other stuff okay so algorithm is a well-defined computational procedure that takes some value or some set of input or basically what we are doing is a sequence of computational steps that transform the input into output okay and here it is talking that when we have sequence of n numbers then we are getting a sorted order or anything so that is also a sorting problem in algorithm okay so So, during our entire discussion in algorithm, when we witness different algorithm, then this is important. We will primarily see the algorithm that is sorting or in some time we will find some algorithm that is searching or these two operations will dominate our entire discussion in the algorithm. okay now there is one question which algorithm is best for a given application depends on number of factors let's say i choose algorithm if you have heard about i will choose insertion sort okay if you don't heard about don't worry i will i will cover all things or i will use merge sort or i will use quick sort okay or i will use uh counting sort i will use bucket sort okay so there are a number of sorting algorithm and it depends upon what multiple factor with algorithm i will choose so let's say when i teach only insert and sort so you do not have any other options so you will primarily use insert and sort for all the sorting purpose okay but when you know merge sort then you think that okay merge sort is little bit faster than insertion sort okay and i can use merge sort because the size of input is very high and merge sort will definitely increase the computational requirement okay so similarly when you encountered quicksort so you think that we may use quicksort because it will produce the answer in a similar time as merge sort, but maybe faster in some instances. So, kind of things we will discuss while separately discussing all the algorithm, which one is better for which scenario. Now, here is first condition because we have said that the the primary operation that we will see will be sorting. So, number of item to be sorted, what is n? So, if n is very small, so we can use any of the algorithm if n is large then we will choose accordingly second thing is that the extends to which the items are already sorted that is important aspect okay so if we we want to sort some element like one three five nine okay here it is seven then 21 25 so here what we see only one element is misplaced. Or if entirely let us say 2, 1, 3, 4, 9, 6, 8, 10. So, here the elements are not you can say more towards their actual position. So, extends to which the items are already sorted. So, that is another aspect or that is another factor. Second thing is that possible restriction on the item value. So, there may be some restriction, the item should not go beyond this or beyond that. So, that factor also we consider. The architecture of computer, kind of storage device use. So, there are multiple factor while selection of the algorithm for a specific scenario. But I am very clear at this stage that these factors you need not to bother above. Okay. Because when we see different algorithm, then you will automatically realize, okay, if in a specific scenario I want, then I will choose this algorithm, this algorithm. So, after seeing around, let's say, 7, 8 algorithms of sorting, all these questions will be automatically solved. I am not more clear about this 4 and 5, whether it will be solved or not, but these three will be definitely solved. So, nothing to worry at this stage. Because assuming you people are from diverse backgrounds, so that is not a concern. Now, going ahead, probably this slide is not very much clear, but when I will say, so try to make it more clear. So, next thing is that, next important aspect that already we have discussed that is correctness of an algorithm. When we say an algorithm is correct or not correct. So, an algorithm for a computational problem is correct if for every problem instance, that is important. If for every problem instance, problem instance means that half problem, partial problem that we were doing if we were just only providing source and destination. So provided as input, it halt, finish its computation in finite time and output the correct solution to the problem is done. So what it say that if we are providing partial input, then also our algorithm is working. If they are providing all input, then our algorithm is working. So this means that there is no cap over the what input we are providing. Okay, let's say I only provide source. Okay, so it will ask you for the destination where you want to go so that kind of arrangement you have to do and here it is a thing written every problem instance providers as input and output the correct solution okay let's say i provide two number for sorting then it will work when i provide three number for sorting then it will work when i provide a thousand number for sorting then it will work okay so if you talk in terms of correctness so the single thing that it is true it is correct for every instance for every problem instance instance means that a portion a part or even entire thing okay that is important okay the algorithm can be uh uh if you talk in the just in terms of english so it is a computer program or even a hardware design that is now you can skip so now important is that what kind of problem are solved by algorithm okay so um there were problem before the introduction of some algorithm and what problem they have solved. For example, a problem I guess some of you have heard about determining the sequence of 3 billion chemical bases, 3 billion chemical bases or chemical base pairs that make up human DNA. So, I guess in all this crime and other stuff we have heard about the term that DNA matching. We heard about the term that is the culprit DNA match with the on-site some evidences. So then we declare that there is a high chance that the person is a criminal or have done some crime. So DNA matching is very popular because of one of the algorithm okay some of you know that is called string matching okay manually if we perform matching of 3 billion chemical bases so it is very difficult now just we provide the values and string matching will check out whether this pattern is available in another string or not or whether this string is available or not then in that case this is so we will see also some string matching algorithm where we will try to identify one string s1 and one string as to how they are matching or whether there is some similarity or not. If the similarity is more than 95 percent, we declare the same DNA. So, this is a common practice. So, we will see string matching in detail. Now, next thing is that next example that is the internet enable people all around the world to quickly access and retrieve large amount of information so how data is flowing what type of network speed what bottleneck we can hold so that comes from the network flow analysis algorithm that we will cover again that is network flow analysis okay so sometime we say key operator is saying your network speed is good but we are not getting the same speed at our home so maybe possible we are using the access points that are not capable enough to uh to accommodate that label of speed okay so that is another example for example um in iit partner we have found that there were on the ofc link were of 10 gbps but at some point um um the the you can say access switch those who are getting can understand and for those so assuming access switch were only support one gbps so there was a bottleneck so we have eliminated those so that comes from the algorithm type that is called as the network flow analysis then in e-commerce we are nowadays doing negotiation and other stuff that is another set of algorithm inventory management is another set of algorithm okay and um shortest route path so uh we always take so traveling salesman problem okay or that is also called as minimum spanning tree so this we will cover in a detail so that is not a problem at all but just giving a glimpse of what type of things this so because uh in most of the cases uh you you people have heard why i am studying this why i am studying algorithm okay Is there any real world application? Yes. So, why I am studying this? Just to get a marks or get good grade or there are some real world application. So, yes, of course, there are multiple real world applications. There are multiple real world application. Now, just covering these two, three slides or we will take your query then cover this. yeah put it so one by one enable mic for those who are raising hand i will take i guess some queries are there then then go ahead yeah okay i think kinshuk is there first and then kushagra l on their mic one by one yeah yeah kinshuk you can go ahead hello am i audible yes yes you are audible good morning sir good morning sir i'm from third semester mca and i wanted to ask to you that do you have any details for a minor project that is mentioned in our curriculum no that detail i cannot i don't have even the information regarding how it will proceed i know about empty by i i don't had any idea regarding mca what would you have to do okay sir thank you sir yeah good afternoon sir yes your voice is little bit sagis be louder sir i want to know that i am kushat for mcl so i i want to i have studied tsa so i want to know sir both uh both subjects have algorithms so how tsa is different from da and so why you have to study both okay so actually uh data structure and algorithm will um will first go towards different data structures if you see the taxonomy dot what we have covered so far array link list stack q all so these aspects we are not covering going to cover in the da okay designing an analysis of algorithm here we will primarily emphasize on different algorithm their computational complexity analysis okay so you can say when you don't know the data structure so it is very difficult for you to go into the algorithm aspect or when you directly jump to the algorithm then it will be difficult okay so uh dsa is designed in such a manner that it will cover both the aspects of data structure as well as some aspects of algorithm but here in da we will primarily cover the algorithmic aspects and their computational complexity analysis though as and when the different data structure come i will also talk about that but not in big detail yeah thank you sorry any other question related to the the lectures i have teach or any so far so just let me know oh hello sir i'm priyanka good morning sir sir i wanted to know if you can share sample papers also for the subject for mtech okay i will try but don't worry when you give the first quiz you will identify that it is very easy to go on so mostly objective type you will get so don't worry about that and sample paper even i have to make again we'll try if i can give you okay or in some lab i will discuss some type of questions uh okay and i mean around one two lab when your quiz one is about to start i will discuss what type of questions are being asked okay sir okay or you can give previous years papers also so because it is on moodle and once the semester ended everything lost so that is happening so we'll try i will try good morning professor good morning uh i have a question with respect to this string matching algorithm uh does it in real world it sounds to have a similarity with semantic matching where we also do the string uh analysis whether the text is matching to the another test rather than the rejects like a to and fro algorithm but here we do in terms of semantic analysis so does it yeah yeah and i i totally agree with you because this string matching was you can say the base then upon the top of it we have started doing semantic analysis and other stuff so so that is yes obviously they are related so string matching you can say it is a you can say forefather and and the cementing mapping in the current generation so that is kind of thing so when we will study yes when we when we will study we will find multiple correlations because on the base the things are same so as a use case i think that resembles it yeah yeah definitely that reason because i i cannot go directly into the semantic matching matching because of the the diverse background people we are addressing so of course they are related okay thank you so much thank you so much yeah yeah you can go ahead yes be louder yeah okay uh sir actually uh i have missed the last class so uh duty taking the id on hackathon i have not used this naming convention like roll number and then your number so is it okay or i should change my profile name with roll number and your name no no no no that is not an issue so from your email everything will be automatically captured because when your email is saved in our database so multiple informations are also being engaged so that is not an issue okay that's why i'm every time i'm saying join with your iitp id because i am also the head cc so i know what informations are being saved so that is not Okay, thank you so much sir. Quickly, I will take the queries. Those who have non-technical queries like classes and other stuff, so we will see after 9.30. I will wait and take. Those who have some queries related to what I have just taught, then just let me know. Anybody else? Because I am seeing number of hand being raised. I have a think about that. Yeah, GC Sarma, you can go ahead. You can query. I am good at you. Yes, other person. I think GC sir might be giving you something. Yeah, Prashant. Hello, good morning sir. Good morning. Be louder a little bit. Yeah, yeah, yeah. Sir, I am a first year student. Yeah. So for my query about in a DAAR, the one thing that is very important is the complexity, like time complexity and stress complexity of the algorithm. So for you to cover this topic? yes yes i guess in next lecture onwards you will see yeah i will cover in i will spend around two three lecture on this time complexity analysis yeah yeah okay i've tried to solve most of the queries if you have any specific query we will again come back okay so let me continue the the lecture or okay this one or two i can take one or two more i can take uh punit is uh provide access to them i have access given to subhasis bakchi and yes hi sir good morning so my question is that like uh to what extent the proficiency in coding is required in order to like uh do this algorithm subject and do we need to like participate in like competitive coding uh if you had time everything is there if you don't have time because assuming you people are all professionals so just follow the labs and if you're able to understand the question in lab and do the question in lab that is more than enough i guess okay thank you sir yes i've given to many one you can see your screen and see the number of mic enables yeah okay this uh dr gc sarma can can ask his query oh sir good morning yeah good morning yes how do we decide if an algo design on paper will perform efficiently on a computer okay because when we do the analysis asymptotic analysis uh when we talk about big o little little big omega so that is a theoretical analysis okay theoretically we are assuming that when the number of input is n, so your computational complexity reaches to order of n square. But that does not exactly match with your machine. Maybe I am using some high-end processor like i7 and someone uses i3. So the time complexity will vary based upon the architecture as well. But in general, how your algorithm will behave and that is theoretically we are stabilizing that these things are necessary. So other factors are also there but most important factor is the input size that will play a pivotal role so that we will discuss so we cannot say directly say the algorithm is taking let's say xr so that is applicable for all the platform all the architecture but in more or less way it will be behaving likewise okay so that is a you can say exactly you can never say let's say two i7 machines are running same algorithm but one has pre-loaded multiple programs so it's the speed may be slow or some machine is a very new so it's the speed may be faster so there are other factors but in general we assume that it will follow likewise okay not exactly we are claiming thank you sir hi sadhar srinivas have a question so assuming that the hardware constraints are the same uh how do we make an apple to apple comparison in terms of two algorithms say for example we have a merge sort and a quick sort now which one perform better assuming that now the hardware and other extra yeah yeah sure sure so that so let's say i'm uh when we say so we have to take a larger input size let's say i'm taking 10 millions number for sorting from insertion sort and merge sort so we'll definitely see the time difference. Are there any specific parameters on which you will say okay if these three are good enough the method A is doing good when compared to method B? Yeah so we will talk about in asymptotic analysis we will talk about the input size determines the computational complexity. So when your input size is larger and we know that it follow the order of n square n log n n so of course n will perform better so that we can visualize okay when we have a larger input size you can see the difference actually and even even when you are running on i7 machine if you do factorial 5 factorial 6 of even factorial 10 so you cannot differentiate the time but when you do factorial 100 you can easily get the difference it will take more time so that that you can visualize okay for it sir thank you yeah okay uh let me continue because if i go with the question and questions who you all people so separately we can talk hours okay but we have to also finish the syllabus so i'm starting and again i will come back and take the queries of all of you okay so okay so now uh critical consideration in an algorithm first one is the time complexity time complexity simply you can see that the clock time the algorithm will take as that is theoretical again and that is theoretically we are analyzing okay theoretically we are saying the time complexity so here i have written one term if you see delay game okay so uh if you go back 10 years from now so you will find the internet speed was in kbs and still we are happy now we have reaches to the internet speed in gbs and and the company that offer a lower speed so people will shift toward the company that is offering a higher speed okay so so this means that faster the algorithm the chances that you will get a good response from the market okay so therefore the algorithm that is having a lower time complexity than some algorithm so obviously that algorithm will win so time complexity play a pivotal role in determining the complexity of algorithm or selection of an algorithm then next factor was space complexity it was very popular when there was a memory constant now we have reaches in um your your laptop ram is more than 8 gb your ssd and other stuff so space complexity is not becoming a complicated factor apart when we are doing some ai based algorithm that then then again it will come but in general algorithm we are not much more considerate about space because for running some program we required few kbs or even mbs of memory not beyond that okay and uh unless we are doing some ai and other stuff so space complexity is not prevalent in our aspect what we have we will discuss so far in this course but when we we talk about AI and ML algorithms. So, of course, the space will play a role. And combining these two, time and space complexity, there is new term introduced that is called computational complexity. Computational complexity means that both considering the strike a balance between time and space. But in this course, we will primarily talk about the time complexity. Space complexity we will also discuss, but time complexity will be more prominent. We will try to reduce the delay. We will try to optimize the selection such that our algorithm will work faster. Then this is important. This will come again and again and again. Then there is some approximation. So we will see some aspects. So making a balance between precision and computational efficiency. What this means that if your algorithm is working on int, integer value, or if your algorithm is work on float. So of course, precision of float is higher, but it will require 32 bit of memory, but int will require how much 8 bit of memory. So in this, this and the computation is also reduced because we have to deal with only 8 bit and computation increases because we are dealing with 32 bit. So this means that the if you compromises our precision, we will get a faster speed. So of course, will come in terms of time and space just taking a short break for two minutes then coming back again yeah sorry for the interruption okay so uh let us start so we were discussing that uh the aspects that are uh being needed so one was time complexity other was space complexity then we talk about some set of approximation if you can enable then your your algorithm will work faster okay then um other aspects are failure probability what are the chances that this algorithm will fail because let's say when we have developed an algorithm for moving from patna to delhi so uh so failure probability will be road closer okay that we hadn't considered okay so what are the alternative if there is a road closer okay so that is other respect robustness and error handling okay scalability, parallelization that we can achieve in algorithm. So these aspects, these four to eight aspects are not part of algorithm itself. Somewhere we will talk about approximation, but other things you will see in a subject name that is called advanced algorithm. So that will work on the top of the algorithm subject. So don't worry about these terms. so approximation basically that one failure probability means that it's in if some failure happened to your algorithm so how it will tackle okay how it will handle the errors and what is the scalability scalability means that if your algorithm is correct for 10 input so whether it is correct for 10 000 input so that scalability is uh tested and uh during the scalability analysis we will uh talk about the asymptotic analysis how your algorithm will behave when input and tends towards the infinity. And parallelization and concurrency, is there any possibility of parallelly running your program or concurrently running some of its aspect? We all know that there are, let us say your PC is octa-core. The processor is octa-core. So 1, 2, 3, 4, 5, 6, 7, 8 are there. But if you do a sequential coding, so you will always use one core, core 1. Other cores are remain idle. So, how you can engage other code as well? So, that is the aspect that you will covered in the parallelization and concurrency. Then the last aspect of this discussion is algorithmic designing technique or sometime it is also called as the that is called algorithmic paradigm algorithmic algorithmic paradigm okay so algorithmic paradigm means that how you are designing an algorithm that can be brute force brute force means that if i have to search something i will search all the possibilities all the possibility is verified. So, that is simplest designing technique. So, it is systematically exploring all possible solution until you get a correct one. So, for example, if my laptop is misplaced laptop is misplaced or my laptop is misplaced okay and i want to identify where my laptop is so i am searching in my bedroom dining washroom kitchen outside garden so that will cover all the aspect unless we find the laptop in our dining hall okay so here we are not applying any sort of intelligence, we are just doing searching, searching all the aspects. So, that is a simplest, but its time complexity will be definitely higher. Next thing is called as the backtracking. So, backtracking means that everyone has I guess solved the Sudoku problem or have seen is, seen this problem. So, Sudoku is a systematical strategy, exploring all possible solution in a structured manner. And whenever we found that we are not reaching toward a solution step, we will do a backtrack. We will do a backtrack. Backtrack means that we will go back. Sudoku, if you remember, you have solved. If you are not getting, so we will go back and check, make the changes, then come back to some other path. Okay. So that is backtracking. So we will cover one by one all the aspects. Greedy is, that is, of course you people know we will know about talk about the local optima or local minima at the stage without bothering about the global minima okay so what the things are correct at this instance i will do it whether it is so i will cheat in the exam to clear the exam i will not bother about whether it is it will let me to some loss or not i will just do a cheating in the exam so that is a local optima or local minima okay and then there is aspects of dynamic programming so divide a complex problem into simpler overlapping sub problem. So, dynamic programming and what it will do, it will store the result of sub problems to solve a large problem. So, dynamic programming, we will see number of algorithm like matrix chain multiplication, assembly line scheduling, other are there. So, we will cover one by one, one by one. So, dynamic programming is where we are storing, we are dividing the problem into sub problem and storing all the results in the sub problem to get back the solution of the entire problem. Then we will see divide and conquer. So, shortly you will witness that we have started this divide and conquer algorithm. So, breaking down a complex problem into smaller one or more manageable sub problem and each sub problem is solved independently. So, that is divide and conquer. Divide and conquer means that when we have very large problem we will divide into sub problems solve all the sub problem combine them and we will get back the result okay so these are the algorithmic paradigms these a b c d and e okay and even there is one more that is called branch and bound that we will explore at clearly here branch and bound okay so if you talk about the algorithmic paradigm or way how algorithms solve. So, I can just write two things that are being written here, I will explain. Later on just give me. So, algorithmic paradigms, the first one is brute force. This is not very popular because of the time complexity, then there is divide and conquer. So if you have in history, we have talked about the Lord Kurjan for partitioning of Bengal and other aspects. So that concept is driven from same. Then we have dynamic programming, then we have backtracking, then we have greedy, then we have branch and bound. so these are the algorithmic paradigm and in each paradigm there are multiple algorithms okay like in divide and conquer we will see merge short quick short binary search and we will see maximum survey so there are a number of problem okay in case of dynamic programming we will see matrix exchange multiplication. Okay, so number of problem in each aspect we will see, I have been backtracking, NQN problem that is famous subset sum problem. Okay, in greedy, a knapsack problem. So number of problems are there. So these are the, you can say umbrella under which there are different algorithms. Okay, then two things that here it is written, it is not an algorithmic paradigm that is NP completeness. We will talk about if a problem is not being solved in a finite time. So, it may go to the NP completeness where we will talk about P type problem, NP type problem, NP complete problem and we will talk about NP hard problem. NP hard problem. So, that is other aspect. So, and there are certain set of randomized algorithm. So, leveraging randomness in fundamental concept, incorporating a degree of unpredictability. okay so these are some advanced algorithm if time allows so we'll cover some randomized like randomized quicksort is one of the famous example in this okay so now this is just an overview of what type of things that we are going to cover slowly slowly okay so let us begin our discussion on the algorithmic analysis. Okay. So for knowing the algorithmic analysis, I will share this PPT. So you will receive by afternoon. Okay. Already I have shared this one, but the updated one I will upload. Okay. And let us begin that. So now we will talk about the, here I have written lecture 2 and 3 because we are in lecture 2 and it will take another lecture for completion of these PPTs. But I will share this today only. So, to do algorithmic analysis, we have to know some of the you can say definitions or examples that we are covering here. First property that is called as the monotonicity. First property is called as the monotonicity. okay. Monotonic, if you know, so that is similar type of behavior is repeating again and again, similar type of behavior is repeating again and again, okay. So, from there it monotonicity come. So, it says that if a function is increasing, so it will keep on increasing. If a function is decreasing, it is keep on decreasing, okay. So, a function fn is monotonically increasing if two values we are taking m and n. m is less than or equal to n implies that fm is less than or equal to fn. So we are considering two points if this is m point and this is n point and we know that the function is increasing. So of course we will get f of m less than f of n because we have chosen a higher value and since this is an increasing function so we will always get what? the function value will change accordingly. Similarly, we have monotonically decreasing if m is less than n, now it is decreasing. So, what we will get fm is greater than fn. So, this is you can say here, here I have taken m and here I have taken n. So, of course, fm is greater than f of n because of decreasing nature. So, monotonicity means that we will ensure that this function behavior is seen throughout okay now if you talk about two other aspects so that is strictly increasing here it is written strictly increasing so here we are not using equality sign and here you can see there is missing of equality signs so when we say it's strictly increasing so it is claiming that at no point of time the m is equal to equal equal to n or fm is equal equal to n. So, there is a strictness that is ensuring that at no point of time the comparison could be made. If you talk about strictly decreasing same equality sign is missing at no point of time, both fm and fn will be seen. That is the aspect. Now, I hope monotonicity is clear. Monotonicity means that. So, if I write fn equal to n square, so that is the for n greater than 0. So, you will get a function like this one or if I draw a function like this one or I draw a function. okay so all are if you can see of different so these are monotonically increasing these are monotonically increasing okay if i draw a function like this one or some this one so these are monotonically decreasing okay so uh these why am we are studying this because we will see while determining the computational complexity, we will identify functions that are monotonically increasing because with the change in input size, when input size increases, none of the known algorithm on this earth will decrease its computational complexity. Will what? Will can reduce the pace of increase, but they will always increase the computational complexity. So, while determining the computational complexity of an algorithm, if we are able to stabilize monotonically increasing things, so it is very much easy for us to determine the computational complexity of that algorithm. Now, I hope there is no query or we will take. Yes, Puneet, so if someone has query, let me know. i think uh some new i can see is krishnan and viso karma let me yes oh mike also there so please see your uh screen uh to whom i am aligned was uh who have their raise their hand basically yeah uh hi hello sir good morning hello so this regarding uh monotonicity which we are talking about right now so you said that in case of decreasing also uh there is a condition that m is less than equal to n and for increasing as well it is m is less than equal to n so for both the cases is it same or for increasing it will be like m is less than or equal to n or for decreasing it will be m is greater than equal to n okay so So basically what we are trying to do, we are trying to identify two set of values from the line equation or something and try to make a representation like monotonically increasing or decreasing. So maybe possible, let's say I'm taking 2.00001 and 2.001, so which value is smaller or greater, so maybe comparable somewhere. But when we say a stricter, so that comparison is not possible or we are very much clear to what the differentiating them. so that that is same function is monotonically increasing and same function is monotonically decreasing will never happen so that equality sign does not signify that whether m is less than n or whether is n is is equal to n so that is two different things so they cannot be combined okay thank you sir sir what is computational complexity computational complexity will comprise both time complexity as well as space complexity but now what happened if we are having sufficient memory and other aspects so when someone says computational complexity so primarily they are referring to the time complexity okay the time in which the problem is being solved the the clock time for example your algorithm take two seconds in getting the output someone algorithm take five seconds so so that that will be the time complexity okay but theoretically we will stabilize the order of n square and log n and other respect so that is different thing but primarily we are concerned about the clock time the program will take in execution thank you any other doubt hello sir good morning uh thank you first of all for the simplest way of teaching i really loved it my i have two questions sir first is about the algorithm you are teaching here are they also related to the ai ml because let's say my specialization is aics uh in ms so would we have the same thing that that you will see so this is a you can say base okay for example when we are using this macbook mac os or windows os so on the base we are basically having unix so that that base will help you out in determining the fundamental foundation right on top of it we'll have different custom algorithms okay yes all right thank you sir the last question that i have is yeah uh the last question that i have is sir like for example i am writing an application for you gave an example of inventory in eco market for say yeah and i have to design an application for my company for inventory visibility okay so there like when i and i'm writing my application in let's say uh java spring boot framework yeah so when i write that application i have to ingest that in like my code or it comes like out of the box in the spring this algorithm and i have to select it yeah so depending upon your requirement you will choose some algorithm you have implemented it is working fine then then we will do the algorithmic analysis so or or what is your requirements you have to handle the inventory or you have to do a sorting of millions of items or you have to just sort few items so there if you just do item then yeah sir i have a question regarding data structure uh so we covered uh last person who was talking so let me finish yeah i'm i'm getting multiple voices right now yes your voice is not clear or i am getting multiple voices hello am i only one only probably Deshmukh is speaking I think okay but I guess his voice is not clear yeah it's not clear hello hi yes yes please so can you ask again so Puneet provide access to someone else let him fix the given to uh i think krishnan and krishnan asked right uh probably yes then again i have given access to uh yeah yeah good morning everyone and good morning sir just like you have given us some examples like monocity so this one can we get some like examples also like where we are implementing and what is in value and values and how it will be it's like increasing i got your point so uh when we will discuss an asymptotic analysis so you will visualize everything so that i will ensure so just wait for one more lecture so that that will come okay i will take one more and then then try to finish one or more property yeah party one alia mudali is there he has party one alia mudali okay i think we can start yeah thank you punit yeah okay so we have talked about the first property that is monotonicity so monotonicity primarily we are saying that we are expecting the same behavior retained throughout retained throughout means that when n was very low when your input size is very low then also this this is applicable and when n is very high, then this is also applicable and even we do not has a condition that after some time this monotonicity property will change or reduce. So, that is one aspect. Second property that you will witness that is floor and ceiling value. So, floor and ceiling value. So, before reading this theory, when I write floor, So, I have to take an integer which is just less than this value. Let us say I am write 3.14. So, the integer that is just less than this one will be how much? Will be 3. When I write minus 4.72, the integer that is just less than this will be what? 5 because in negative series we have to go in a reverse direction. Similarly, this is floor. Floor means that an integer that is just less than this value. And when I talk about the ceiling, ceiling means that the integer that is just greater than this value. So ceiling of 3.14 floor will be 4. Ceiling of minus 4.72 will be what? Will be an integer that is just greater than this will be minus 4. So these are the two aspects. So when I say floor value, floor value means that I am eliminating the decimal and other aspect and I am giving you the integer part. And when I say ceiling value, then I will give you an integer that is just greater than this value. So here it is written for any real number x, we denote greatest integer less than or equal to x that is called as the floor. Okay, so that the integer must be very close, very close to. For example, this is greatest integer that is less than or equal to x is denoted by floor of x and read as floor of x. And the least integer greater than the equal to x is denoted by ceiling of x. Okay, so there's these two values are very famous. Okay, ceiling and float. Ceiling means that just greater than and a float means that just less than. So, here is one property written. Before writing this property, let us solve this. Then I will check out this property. So, I am talking about floor of 3.14 will be 3. Ceiling will be what? 4. Root 5 is what? 2 point something. So, its floor will be 2, ceiling will be 3, minus 8.5 integer that is just less than this is minus 9 and just greater than this will be minus 8. 7, no integer issue, no integer issue. So that is there. So if I ask, determine the ceiling of minus 9, determine ceiling of minus 9. So it will be what? integer itself, that is minus 9. If I say determine minus 9.36, so it is again ceiling is minus 9 because that is the integer that is greater than this value. So that is here, so I hope you people got an idea. Ceiling means that we have to pick out the integer that is greater than the value and float means that so here we are not bothering about whether it is 3.14, 3.88 or 3.21. Everywhere we have to choose an integer value that is less than than it is floor that is greater than than it is ceiling and it should for example the integer that is greater than 3.14 is 5 also, 6 also, 7 also but we have to take that is least that is just greater than this. Similarly, that is just less than this. So therefore, it is said that greatest integer less than or equal to x. Greatest means that the highest possible value that is as close to the x while evaluating the floor and the least integer, the smallest integer that is just greater than this value. These two things are tricky. So floor and ceiling values okay so i hope you people can visualize i will share the ppt as well so you can check it out um here is one property x minus one less than floor of x less than or equal to x less than or equal to ceiling of x and less than x plus one so if you take example so 3.14 minus 1 is 2.4 floor of 3.14 is 3 exact number is 3.14 ceiling will be 4 and plus 1 will be this one. So, this is one interesting property. This is a one of the interesting property that you can refer while determining the floor and ceiling values. Similarly, here is another interesting thing, floor ceiling plus 4, number by 2, we will get the number when n is an integer, where n is an integer. So, 5, 2.5 ceiling is 3 and 2.5 floor is 2. So, ultimately we are getting 5 as a output so clear floor we have to see lower side ceiling we have to see higher side just that is simple definition okay so when i see floor i say floor so i will see lower when i say ceiling then i'm getting see just higher both this is just lower and this is just higher integers. And of course, the pelvis should be an integer. Now, there are some other properties that are relevant with this, but you can skip if you do not go into the detail. So ceiling of x by a by b of ceiling, ceiling of x by a by b, whole ceiling will be x by a by b. Similarly, floor of x by a by b will result into ultimate. So, you can take any example, check out the property it will hold. Similarly, floor of a by b is less than or equal to a plus b minus 1 by b and this one. So, these property you can easily prove by just taking a example. Here it is written, just check it. For real number, x should be what? Greater than equal to 0 and it should be a real number. Real number means that decimals are allowed and a and b greater than 0 and these are integer. There is a condition. This property will hold when x is a real number and a and b are the integer values. So, I hope you people got the gist of what is floor and ceiling value. And modular and other aspect we will start in the next class. I am ready to take some queries. Those who have done can leave the lecture. I will upload in a one and two hour these lectures on the Moodle itself. I have also uploaded the Corman book. So those who are interested can refer to that one also. so thank you all and two three queries i can take and those who have done can leave the class hello sir hello uh so i have a query with respect to the dynamic programming in divide and karkar how they are actually different like it seems like both have a strategy to sub divide the event or the instance what is being happening so how the problem statement that is very good question and most of the time asked in interview as well. So, in both divide and conquer and dynamic programming the mechanism is to divide the problem into sub problem. But the difference arises the dynamic programming is toward the result of the previous step to get back the output of next step. But in divide and conquer this is not the policy. So, that is one aspect and divide and conquer is primarily a top to down approach. Top to down means that we will divide, divide, divide, divide the problem in very small then combine combine and get the result in dynamic programming it is primarily a bottom-up approach we will solve a sub problem store the result and then go to the last problem then we will solve again it then store the result and go ahead so this storing will reduce the computational complexity so that that's why dynamic programming are treated as the fastest algorithm paradigm but on the cost of memory so the fine difference is we are storing the previous result or not storing the previous result strategy is top to bottom in divide and conquer and in dynamic program it is bottom to up okay sir thank you sir yes sir i wanted to ask about the monotonicity so you are you are using the function so that function is mathematically function okay so there are many types of the function like continuous function discrete type of the functions so which type of the function we will use there so uh in in when we determine the computational complexity of an algorithm then we will definitely get continuous functions okay so we'll we'll see how an algorithm is converted into a form of a function or a continuous function just give me a while yeah just okay okay uh hi sir good morning uh sir my question just give me a while just just stop for a minute and yeah i'm i'm here uh yeah please ask oh yes thank you so so my question is quite 11 not technical so actually this is my first class i want to know about the assessment that you have assigned last time although i have not found anything in the noodle assessment session so is there any other process or any other way to submit the assessment or how committed myself uh no worries so we will will open the window for uh next uh you can say next session and or probably tomorrow i will tell how you those who have missed the the earlier aspects can can cover okay okay so thank you yeah so don't worry about the marks and other stuff i'm there to help you out okay sure thank good morning sir good morning for this nice class so i have one uh technical query and one non-technical So, first one is that monotonically decreasing. So, we told that there is the computational complexity that we can measure. So, if things like that, if our time and space I plot with that computational complexity, so every time that function will be monotonically decreasing, right? means we need to chase the computational complexity always low right yeah yeah and yeah means how how to uh explain uh this monotonically decreasing man means where i need to use the monotonically increasing uh functions and monotonically decreasing one yeah so just clarifying your doubt so monotonically decreasing is just a property i had tell you okay because none of the algorithm on this earth that will reduce its computational complexity when input increases that i guess you believe so always we will try to stabilize up towards the monotonically increasing okay so uh computational complexity increase when the input size increase so we will try to establish that that aspect okay because no of the algorithm will reduce its time complexity when we are providing more input yes sir so that is for the sake of clarity, there exists a monotonically decreasing also, but we will see monotonically increasing function in all the aspects, all the problems. So, that means if we put the input increasing, increasingly, so we always get a chance that complexity will be increased. So, that is that monotonically increasing, but our aspects should be that to nullify that complexity and… that you reduce or minimize we cannot nullify it we will reduce it okay sir thank you it's clear now and one more uh non-technical one that is uh regarding the assignments so uh every assignments you uh given to that uh hackathon lab challenge so that will be including as a marks uh in our exam if i say clearly so it is no but let's say when your sum of the exam is not so good so i had some base to give you extra marks so for that i'm preserving that one okay okay sir thank you very much good morning sir good morning sir in class you told like the one algorithm is the time algorithm and the shortest path algorithm both are combined in a one single algorithm so my question that like it will work separately or both will work together how we will calculate the like shortest path in the shortest time or the it is also intervene the speed so like all three combination will work together or how this algorithm will work so I'm not getting exactly what you are asking so can you slowly repeat one algorithm is the time algorithm and another is the shortest path algorithm so we will get we are calculating the both one at a time with the speed so all the three algorithm will work separately and give the uh final result or it will depend to each other so uh individually their their their results are calculated and while combining we will use so for example three three algorithms are there okay um in or three sub problems are there so let's say one sub problem is little bit complicated so the time complexity depends upon the execution of that sub problem and while combining we have to wait when all three are ready then we will combine okay so it will give uh the sort test uh with the combine all the three algorithm it will calculate uh separately then combine yeah then give the uh multiple results yeah yeah okay thank you hello sir good morning uh i actually had two non-technical questions to ask first of them is like uh if there is an elective which has advanced written in front of it are there any prerequisites for that like if it's advanced cyber security then is it for the next semester or can we do it this semester and there's no prerequisite course that we have to do before that actually actually what what we we know because you all people are working professionals so we are not assuming that you you are too much with the the things that are being um evolving in that particular subject so if still it is written advanced so first base will be clear then only we will go to the advanced system so it does not mean that you should not take advance and you will never find a subject naming without advance because in mtech we are teaching subjects that are little bit you can say upper side of btec one okay so we can offer those right yeah yeah that that that you can opt and the second question is like even if uh i had a conversation with one person who told that even if you are looking at the recordings our attendance will get marked uh but we have to log in via our iit id right so i did it but i yeah um yeah please save okay so uh so exactly what the question you are asking i do not know how they are doing these things okay so i'm totally unaware of the how attendance is being done while being the that video and others yeah okay okay okay then thanks i guess thank you guys hi sir hello hello sir akshay here yes actually so sir do you recommend that book you said