# DAA 16 Aug 1st

- **Course:** 5101 - Design & Analysis of Algo
- **Recorded:** 2026-08-16 00:00
- **Transcript:** 667 segments, 11325 words
- **Made by:** deepdml/faster-whisper-large-v3-turbo-ct2

---
So, if you compare the making burger, it is also a step by step process to do some tasks. So, our task was making burger. In the early morning, I guess, very few of you want to eat the burger, but let us think about why, whether it is an algorithm or not. if you go with this layman definition, step by step process of doing something. So, of course, the answer comes in your mind will be yes, making burger is an algorithm. Now, let us think about a very simple example. Let us say, let us say I had 5 number 10, 7, 3, 20 and 2. And now I want to sort this number. So, I will write some algorithm. Sort means that arranging in ascending or descending order. So, I will just sort this number. Then what will happen? 2, 3, 7, 10 and 20 will come. Now, so again requesting everyone to join via iitpid because this thing will come up here. Now what we have did, we have sorted this list or array you can see, it is like this one in ascending order. In ascending

order this list is sorted. Now if I provide another list 3, 9, 2, so this will be also sorted. So, irrespective of the input size, we are always getting the correct result. In the sorting part, irrespective of the input size, we are getting always a sorted array. But here think about the situation, if I provide partial input, if I provide partial input, this making burger will be not a significant process because your taste will automatically compromise. So, if I say an algorithm is a step by step process and it is applicable for variable set of input and it will always produce a correct output. And making burger if I compare with that, if i reduce the input then the resultant may vary okay so this clearly indicates that making burger will not be a algorithm okay although we can say it is a flow process process flow or something but it will not an algorithm because algorithm should be have a well-defined processes okay and that is

applicable for partial input as well okay another thing that that we can say that here ordering here ordering of one component over another component hardly matters but here when algorithm proceeds it ordering or flow will be managed and steps will be well defined okay so two things that we got from here. One is it is applicable for partial input and second one is it is well defined, it has well defined steps. So, there is two things are necessary to call a step-by-step thing as an algorithm. So, later on we will discuss about what are the steps that will verify the correctness of an algorithm and and then we will again we try to define what is algorithm actually is since this is a just an example on my slide so i just shown you making burger is not an algorithm because of two reason its steps are not well defined and second reason is its applicability on the partial input is not verified okay so now think about this person who

is thinking about different algorithms so for those who are starting this lecture for the first time so they of course will be in this situation but don't worry on this PC you have to just see my PPT that is more than enough for all the examination and I will try to convey as much as I can okay and this these PPTs will be available on your Moodle account so just after the class I will upload this PPT and you can check check it out okay so now let us have a brief introduction about me. So myself, Dr. Rahul Prishra have done my PhD from IIT, BHO, Varanasi. And these are the two email IDs that you people can use for sending some query or something. And also you got an email ID through which I had login. That is semester first, uh mtech okay its name is csc514 and um fortunately i am also part of the authors for writing a book designing an analysis of algorithm okay so uh that book is also available online on the aicte portal you can access it as and when required so

that book you can refer and and check it out so mostly the things that i will cover in the the slide will be part of two books that is coreman so coreman is you can say the bible of algorithm okay so coreman you can easily get it online it is freely available it pdf is freely available okay and those who are not quite willing or don't have time because you all are working professionals so they can just refer my ppt that will be more than enough okay and this book is also available on AICT portal so just search it out you will get it now these are the some books so here this is Corman so this book is introduction to algorithm now it is coming in the fourth edition it is a costlier book but you can see all the concept of algorithm designing computational analysis has seen every step is covered in this book so mostly I will follow this book introduction to algorithm okay and that book is famous known as core map okay so that you

can search on the on your web you will find this book its pdf variant is available okay and there are other other book that is of ulman and these one but preferably try to follow this so important thing is that all the ppt's in the class will be provided to the student so so that is a great thing and second thing is that i will try to align some of the published paper so if time allows okay so first thing is must i will do it and second thing will depends upon how much time we are getting beyond the uh classes okay because the uh you can check the syllabus of algorithm is quite vast okay and we have a heterogeneous set of peoples who those who are getting the classes so that will a little bit slow down our speed but of course i will i ensure that those who are attending this class must take away something good from it okay so this is a journal terms so you can get the course to introduce the concept of data structure

and there, inter-indiscibility in the implementing algorithm and how it is improving the performance. So that is not an issue, that is you can say pretty theoretical thing. So just go through it. But our target is to learn the concept and at this stage since most of you are working professional, so our target is to start thinking in this domain how the things are changing and what are the factors that we are considering analyzing the algorithm that one by one i will discuss so here this is prerequisite but i say it is not this is important red one is your curiosity to learn new things that is more than enough but those who know c programming they are welcome we also provide python in the lab and those who can do c plus plus java okay so primarily in the lab we will have the hacker rank based hacker rank based you can say coding so what we will do today in today's class me and my teachers will tell you about how to make an account okay account on a

hacker rank and then some set of questions will be provided first he will explain you all the concept how to implement it how to run it then you have to run and submit your code on the hacker rank it is automatically evaluated and marks will come to us the good thing is that uh through hacker rank you will find the questions that are a part of some of the competitive exam and also will try to align with the class as well since in this class we hadn't we will not able to cover some algorithm or some stuff so we will start with very basic link list or something okay but after next class we will when we go through some of the algorithm then this thing will purely align with your class okay so this is about the hacker rank important part is that when you make the account of hacker rank you should use iitp id okay at the rate iitp because this will help in identifying us what you people are doing because if it is not an iitp id we will not get any detail but iitp id hold all your information

that we can fetch and marks will be aligned accordingly okay so that is just a very small thing in lab class today that is going to help from 11 you will find all the detail of how to create an account in hacker rank what are the features it offer how to change the language from python ccc plus plus so all stuff we will cover in detail okay so don't worry about it so this is just first lab so we are not expecting that you all are well prepared for this so we will let you know all the steps and important part is that make your account with iitp id okay so i hope the things are clear to you. Let us begin the main lecture part. This was lecture 0, just an introductory. So, starting that lecture, I will share this with PT just after this class. So, now let us start our lecture. So, the previous one was the lecture 0 or you can say the prerequisite lecture for this. So, now designing an analysis of algorithm. So, algorithm

So, let us think about in a different way. First, we will have some data. Let us talk about we have to store some data. Then for managing and storing the data properly, we need what? Data structure or we can say that logical organization of data. And when data is collected. So performing certain operation on the data, we need some kind of algorithm. We need some kind of algorithms. So we have data, we have idea about data structure. So assuming some of you are aware of data structure, but if it's still not, then I will just define today and it will be fairly clear. And on the data structure, when we perform certain operations, that is like step by step process what we have discussed so far, then we will reach to an algorithm. And after algorithm, we will do the analysis. After the algorithm, we will do the analysis or that is called as the computational complexity estimation or sometime it is known as asymptotic analysis. So, we will go very slow. So, first we will try to define

what data is then we will discuss on why data structure is needed and then we will try to define the algorithm. So let us begin with this and for those this is the first time they are studying algorithms so do not worry through my lectures you will get all the things done. So now let us talk about data. So I guess in this era of you can say AI and other stuff everywhere we are flooded with the number of data our social media our email our other activities that we are performing data in form of images text everywhere we are flooded with the data or you can say there is a common proverb we are in the deep neck flooded with the data okay so now what is data so data refer to any set of information that can be stored analyzed and use for decision making. Simply I am taking, let us say your attendance. So, your attendance in this class is automatically marked. So, there will be some kind of information, your name,

your name will be there, then you are present or absent, present or absent, then for different, different days it will be there. So, this is also a data. Because how attentive you are in the class will be monitored by the attendance you are taking in the class okay so so this is also a form of data now let's say i have to identify who is more attentive in this class then i will do what i will just check the recorded attendance and from that i can easily identify or take a informed decision making about your presence okay so it is a set of information that can be stored so this attendance we can easily store it anywhere, analyze. So, let us say I just want to know who is more attentive in the class, then I will do this analysis and then I take a decision that the person A or the person B is more attentive in the class because attendance clearly reflect this. Just one more thing. I guess some of you, not all, assuming all are very much attentive. So,

in the last sessions what my experience say some people just join the call off their camera off their mic and keep on sleeping okay so i guess some of you are there because it is a weekend time you all are working professional so some may face this issue and early morning classes are likewise and but i hope most of you are awakened and listening what i am saying so this lecture could be probably you can say a little bit theoretical work but next lecture onwards we will see good algorithms running and calculations so automatically you will not be stuck into the sleepy mode okay so now i will give chance for taking your queries but let me complete something then i will take the query so data can take many forms such as numbers here numbers are there words images or any other type of input that can be recorded digitally or manually okay so that we can record digitally or manually and data come from various source not even limited to this one

okay databases social media sensors and surveys okay so here it is written if you see in order to be useful data must be organized analyzed and interpreted so here data could be a quantity could be an information, could be some graph, could be some measurement, kz, kilometer or anything, some observation, sun rises in the east, moon rises in the west kind of things, some facts that actually happen and some numbers. So, data could be anything and beyond this also, not limited to this what I am saying, information, quantity, number, fact, observation, measurement, it could be beyond this also so then here this we are not going to cover this will be covered in the different subject data analysis involve statistical or computational tool to identify patterns and trends and relationship within the data so this this you people will cover mostly in the ai and ml subjects that you are here with so that is other aspects so i'm not

going into that the analysis can be drew can be used to draw conclusion make prediction and inform decision making in the wide variety of field so our target is not to emphasize on data analysis but our target is to emphasize more towards what data is i hope new people understand the data is nothing but it is a set of information of these form quantity information graph measurement observation fact number that can be stored, that can be stored, analyzed, used for informed decision making. That simple defines the data. Now, why data, what is data structure? Now we have plenty of data, plenty of data and we want to take some informed decision or you can say data informed decision then what we will do we put all so let us consider simple situation let's say we have we have created multiple world documents in our pc and we have flooded all of them on our desktop if certainly some people ask you open that file then what we will do we will keep on searching

here and there and there and there and ultimately we form a file and open it okay but if it is well organized date wise it is sorted or the the the files are kept into different different folder of different different aspects then you can easily fetch out that data okay so this means if our data is properly organized the search time okay and if you want to insert new new into that folder so insertion deletion searching everything will be easy or you can say not easy it will be faster. So, organizing data helps in faster access. So, access could be any form. We want to search something, we want to insert something, we want to delete something that could be performed. So, data may be organized in many different ways. The logical or mathematical model of particular organization of data is called as the data structure. So that is important. So we have plenty of data. So how we can organize that it will be defined as data structure.

So how to choose a data structure? After this slide, we will see about there are different types of data structure. So our choice will be what? It must be rich enough in a structure to minor the actual relationship. So for example, when we buy the movie ticket from this PVRs and other stuff and then we, let us say this is the window we are in the queue. So this is queue. So there is a data structure name queue also that you can directly map because it resembles directly with your situation. So queue data structure can be used because it is reflecting the actual situation of your scenario. Similarly, let us say I have to say five number. So, I will simply use what? Array. I will explain what is array is, what is linked list. And second and important thing is that the structure should be simple enough that one can effectively process the data. It does not mean that for storing very less amount of information, we have to do what? We have to

perform, we have taken a complicated data structure whose execution is itself complicated. So that we have to determine. So for storing larger value, we will prefer a linked list, for storing very small set of information, we will prefer arrays. So this admitting thing will come repeatedly in this class, again requesting everyone to join via ITP ID. So this thing will not appear. So, here is an you can say taxonomy of data structure. So, we have understand data and now we are working toward data structure. So, data structure is in categorized as primitive. So, those who have done some programming or any stuff, they know that the data could be what? Int, float, double, long double, real number. So these are treated as primitive data structure or you can say they are the basic data structures. Now when we talk about non-primitive, non-primitive means that the collection of, you can say, collection of primitive

data structure. So here there are two basic categories, one in linear and another one is non-linear. So linear means that the organization of data will follow a sequential order. So data will be stored one after another. Okay. So, likewise, let us say I have to store some data. So, I am storing here 10, 9, 7, 6, 5, let us say 17. So, I am following a linear order and the axis will be how much? Axis will be one after another. I can access this, then this, then this, then this then this if it is one two three four five six so i will access first then second then third then fourth then fifth then sixth and their addresses are of two type either can be follow the same sequence so in case of array their addresses are fixed and one after another let's say it is 104 then it will be 108 this is 112 this is 116 this is 120 124 but in case of linked list we can also see the addresses are changing that we will discuss. So in linear data structure,

the aim is to logically organize the data in such a manner that their access is one after another or sequential. So here access will be sequential. So in this linear type, we have two types of data structure. One is static and another one is dynamic. So static means that once we define the data structure in the beginning of the program, we are not going to modify the program during entire execution. So once we declare an array, its size is 10, so we can only store 10 elements. And if we have to change, it should store 100 element or 20 element, then we have to rerun the program. So during execution of the program, the structure of the data remain static, or we cannot alter it, then we called as the array. Okay, so, and again, when it is an array, the element will be stored in such a manner, where access will be primarily sequential. Okay, but in the beginning of the program, I declare size 10. And I want to increase

the size to 12 during execution. During execution, then what I will do, I will choose some dynamic data structures like linked list linked list is what linked list allow us to insert new space or remove empty spaces from an uh storage during execution during execution means that during run time when your algorithm is running in that time also you can update or modify the space as and when required but in case of static it is fixed throughout okay then there are other dynamic data type like stack and cube that I will discuss just after this slide. Then when we talk about nonlinear data structure, so we are primarily talking about tree and graph where the order is not sequential rather than it will be hierarchical. It will be hierarchical like this. This is a tree. Similarly, we could have a graph. So these are the nonlinear. So first I will store some element here then here then here so it is no longer sequentially storing okay it is storing in a

hierarchical fashion or some other fashion not sequential one okay so this is an taxonomy of how data structure look likes okay so before detailing all these let me take your queries so i forgot the name hers i guess you had access you can enable the mic for those who are willing to ask some question as you can enable mic for those who are raising hand okay i've given first time i've given the access to sing robin yeah you can ask your query so uh as you have started the recording now i guess i forgot yeah yeah yes i started thank you very much yeah yes uh saying there have been what what what is your query okay moving to the next so you can access provide to someone else okay mic okay hello hello yes yes uh can you hear me sir ah yes yes i can hear clearly yeah uh sir actually i want to know like since you told that uh the there will be hacker rank for us to solve data structure and algorithm questions so i primarily use python for data

and uh data structure but there is a problem with python that most of the time it gives runtime error i like the uh for other programming languages which are currently faster compared to c plus plus in java python is comparatively slower so the sometimes it doesn't submit so to deal with those problems what can we do i have to ask the question because i have been okay the deadline will not be the fast it could be around a week you will take you can take your time and submit there is no such limitation you have to submit in five minutes or 10 minutes okay no sir i'm not saying five minutes or 10 actually uh actually what i mean to say is uh like in python the runtime runtime it takes longer runtime compared to java and c plus plus yes yes yes yes so that's why sometimes now my solution is not submitted because of the runtime error okay that we will see but in the last semester also most of the students were doing in python

and their submission was very easy so there was no bug at all i guess so if it come then we will try to resolve it okay sure thank you sir okay next puneet gosh yes puneet yeah i want to know like which language will be uh doing this so that is totally up to you and and if you um because i will so because in the hacker magnet there is a provision you can change the language on at runtime what language you want okay so you can use python you can use cc plus plus what is your wish you can use it no but what will be uh that i want but i'll do any pattern for sure but okay because um because in we have two hours lab and we are not targeting 10 20 questions three four questions are there so uh primarily we will also try to go in the python because most of you are aware of it in some of the part if it is in cc plus plus we will let you know and explain all the steps entirely so so that will not be going in primarily we will prefer c but

depending upon the strength of the class what they demand we will go with the python i guess yes you can ask your question akhil raj yeah hello sir hello so my question is uh we are storing all data in the form of zero and one yeah then then how we are classifying it based on primitive non-primitive like into the bulgian this i not understanding okay so just so let's say i want to store number four okay and you use the representation of four is what one zero zero okay so this is the binary equivalent so when i declare that four is an int so four bits are reserved in the memory when i declare four then eight bits are reserved in memory and so on okay so that conversion is a background thing we are talking about the logical structure how four is stored in the memory so when you reach to the memory location it is not four it is that binary equivalent okay so we are talking about the how data will be stored how four will be into four will be stored how float four will be stored

okay and how it look like into the memory that is part of memory organization okay so when i say i will store 20 on a float number 20 on certain location so on that location when you reach you will find a binary equivalent not that number okay so don't confuse in that okay data structure is a logical organization of the data and what type of data will be stored in the memory will be catered by the memory organization okay and we are talking about logical organization of the data not memory organization getting yeah thank you sir yeah okay next uh bhanu kumar good morning sir so my question sir sir my question is related to the i mean uh syllabus so syllabus i got the syllabus and the reference book so you have mentioned the reference book for uh this design analysis is the core man so this is the suffi this book is suffice for uh this semester courses sir okay but that book is not for this semester in in your life whatever algorithm

data structure advanced algorithm you will study that is more than enough so it is not possible for me even to complete that entire book in three semesters uh okay okay sir you can say everything it is pulled yeah okay and so next question is how we can choose the elective sir so can you just incite some on elective collection so that is totally up to you and there are some set of elective only running all elective does not run at a time okay so so depending upon the who which professor is offering so that elective is limited by that so in that i cannot help you that is totally your decision okay so suppose i choose elective a but that a is not offering by the professor so how do you know sir no no so the electives that are being offered will be shown on your model other elective will be disabled oh other elective will be disabled yeah yeah yeah okay uh just i will take a two minute break then come back again and take the

queries then begin the lecture okay just taking two minute break okay sure yeah uh yeah uh can you i mean any anywhere mention it's the subject name and uh the reference book list is there any pdf something like that there is no pdf as such but sir will be sharing this ppt so we can use that oh okay okay thanks then i'd say uh has can you some insight on the uh hiker one so hiker rank so what is the purpose for the hiker rank i'm totally new for that so i don't i'm also a student only but i'll just tell you what is a current hikering is basically a coding platform so that's like in exam we get question and answer no we get question we write the answer just like that in hackerrank you will get coding question and you need to write the coding for that in python c c plus plus any language you can use and try to find the answer for that coding question in simple terms yeah in the seminar okay thanks thanks a lot yeah okay uh so we'll take two three

query and then we will uh start our lecture yeah you can ask your doubt i've given you the mic access you can turn turn on your mic and speak okay no worries uh you can ask so if you have just generic query like this subject and other stuff we will handle separately so So Ankit has raised three times. So enable Ankit. For Ankit Sakshena, just enable the mind. Yeah. Ankit, you can speak. Voice is not clear, Ankit. Is it audible now? Yes, yes, yes. Yes, yes, please. Yeah, I have two quick questions, sir. This format book, we can found on the library, the central library for algorithms. that is available in the central library and its PDF variant is available free of cost on the MIT archive okay and second question sir this hacker rank email ID you want us to create before the lab we will show how to create okay but the preferable that you should use your ITP ID because determining the marks from that will be very easy got it take it yes assis assis i can take your query yeah assis you can

turn on the mic assis kumar singh okay then uh dashmook ulas maruti you can ask your doctor hey hi good morning god so uh sir uh i have just uh want to revise the uh last graph we have shown just to make sure my understanding correct so we have uh primitive and non-primitive and in the non-primitive uh we have uh uh sorry again linear and only linear and linear non-linear and within linear we have static and so the way i understood is uh like uh in a non-primitive we are dividing based on the sequence if those data structure is linear or non-linear and then in the linear we are dividing based on this uh the way we are storing it right dynamically whether we can change it or not during execution okay and then the non-linear it will be like tree and graph that way so if i so if i understood this thing like in a non-primitive i need to look at first the sequence of the literature and then the uh the way it will be stored it will be easier for me to

remember this thing right yes yes yes sure that's good okay thank you sir i just wanted to come from okay so uh those who are having raising their hand so we'll have to wait uh i will start my discussion on the lecture then again i will come back in a 15 minute then again i will take the queries okay because handling queries for such a large population will be difficult and our lecture will be hampered but definitely i will come after some time and then again take your queries okay so now talking about the arrays so just this definition you people can read just if i so so here i was storing 5 10 20 25 30 35 so these are the indexes okay 0 1 2 3 4 and 5 and also in some of the languages 1 2 3 4 5 6 these are the index term this is the actual value okay this is is the actual value, these are the indexes. So, for simplicity afterwards, after this definition, I will always use this index because that is simple to understand. Otherwise, you are free

to use 0, 1 and 1, 2 that is up to you. Similarly, let us say we have a data like this, where multiple 1D arrays are connected in a plane. So, what we will found a 2D array, that is columns and rows so now when when these arrangements are likewise multiple that become a 3d array and 4d and so on so array arrangement is that the elements are storing one after another and here important part is that in array the memory is contiguous the memory is contiguous because we cannot let's say this is the memory arrangement so we have to store the array in this only okay we cannot take one location this another location this another location this because that is not allowed if we can do the this this we can do this in the linked list okay so elements are stored sequentially and a contiguous memory location is allocated before execution of the program. So, here data will be stored sequentially on a fixed contiguous

location, fixed contiguous location. And likewise, if I want to store this, so I will do what? row wise, then row 0, row 1 and row 3. So this is also sequential arrangement. Here we will change the direction. Then here we will change the direction. So this is also sequential. In 3D also similarly for first plane, second plane, third plane and so on. But important property here is that we cannot change the dimension of the array once the program is in run. Program is done because we you have hit the button of run the code so in that time we cannot change the location but linked list do allow this okay so that we will see so array is nothing but a arrangement of the element in the sequential order again i am saying data structure it is not a rigid thing it is a logical arrangement we are logically arranging so that we can access fast in memory it is in a different way the data is stored it is just a logical arrangement data

structure is a logical arrangement okay and theta structure is a logical arrangement and elements are stored in a sequential order okay one after another what you can say and addresses that we are choosing for an array is also a contiguous we want let's say we want to 10 element i store 10 element so 10 locations will be contiguously available in the memory what i mean to say this is the memory arrangement number of stories are there so I have to reserve 10 space here then only I can declare an array and if let's say three space is available here then some entries are there then two space is available then some entries are there then five space is available so we cannot accommodate an array in it because array one contiguous location if the addresses should be, so here I am writing 100, 4, 108, 112 because integer need at least 4 bytes. This 108 need 4 bytes to store. 112 will be stored in 4 bytes. In C sometimes 4 bytes,

but in most of the cases you will find 8 bytes for storing the int value. So that in that case 100, 108, 116, 124 kind of addressing mechanism will be used. But do not worry about that. We are not going into the detail of how addressing and other stuffs are done. Our target is to store the element sequentially on a contiguous memory location. Then we will declare it as an array. Next data structure that is famous that we have also discussed that it is dynamic. So, let us say in my memory, I have to make an arrangement of storing. This is let us say your memory and these spaces are already reserved. And now I have to store six elements. So, already we know these spaces are reserved. So, we have 1, 2, 3, 4, 5, 6. But they are not in a contiguous order 1, 2, 3, 4, there is a, in between something is there. So memory is non-contiguous. So we cannot use array here, we cannot use array. So for that we need link list.

What link list say, I will store, let us say this value is stored on 104, this value could be stored on 108 this scale can be stored on 128 and this scale value can be stored on 132 okay so it is not continuous in between there are other spaces like 112 maybe already occupied 116 120 124 these are already occupied but still we are able to store the sequential data a b c d because of the linked list property that we can store the element in the non-contiguous order. So how it is achieved? So let us say I stored a value data here. So I will stored a pointer also where the next value is. So here the pointer will be 108. When I stored B, the next pointer will be 128. When I stored C, the next pointer will be 132. And the last element will stored a null pointer means that we have reached to the end of the linked list. So, linked list can perform or can do in non-contiguous order or the arrangement of the

addresses may be non-contiguous, but that is compensated with the help of an additional field that is called as the address field. So, in linked list, when we store the information, we store two things. One is the data or information and another thing is the address of the next node, address of next node. So in this way, a sequence is formed, but in a non-contiguous fashion. Another important part is that in linked list also allow dynamic insertion or deletion of the available memory. So for example, if D is deleted, if let us say we perform some operation where C or D is deleted, so automatically this space will be given as free space. in case of array if we declare an array of 10 okay initially and we are only using two locations so all these eight will be wasted or will be continuously engaged when our up till our program is ending okay and in case of linked list when something is removed or deleted likewise these

two when they are removed or deleted its space will be freely available in the free space of the memory so one property of the array is data is sequentially arranged addresses should be contiguous and we cannot improve or modify during the execution of the program while in case of linked list we are the elements are stored sequentially but they can be stored in non-contiguous location and allow the dynamic change in the memory requirement okay dynamic change means we can add more memory as and when needed let's say i want to store e all so so i need not to stop the program i will just declare one array and add let's say at location 10 104 is available now so we will declare it and it's this pointer will be go to the 104 and now since the last element its pointer will be none okay so that can be automatically done if your program demands some extra space that will be if it is available on non-contiguous

fashion that could be allocated to the linked list and if linked list operation required limited number of nodes the other nodes will be freed and added to your free available space so that is the you can say dynamicness that this linked list offers okay but here access pattern is again sequential therefore it is also called as the linear data structure i hope you people can visualize so how non-continuous thing is maintained because we are also storing the address if we don't distort the address so we have to store a b c sequentially as like as in the area because in case of array we are storing element like a b c d so if this address is 104, this is 108, this is 1012 and so on. So when we know one address, we can determine all other addresses. And here, one thing is written that is head, sometimes it is called as the start. So this indicates we are at the first node. So there is a specialized pointer that indicates

that this is a start node. And for end node, we know that there will be a data and the next address field will be null okay so you can also refer more about the linked list if you wish but in our algorithmic discussion we will rarely find the this linked list because that is purely based upon the algorithm and data structure is what prerequisite for this course but since you people are working professional so i don't assume being from diverse background you had all this stuff so slowly slowly what i am teaching just grab it so that will be more than enough okay now in case of linear data structure if you remember two other things are there that is stack and q and that are also known as the derived data type derived data structure okay so here simple stack if you remember so you can say making a storing chapati at home so what we get if first chapati will come second third fourth fifth sixth and so on. So but eating will be done what? First last will be eaten, then second last,

then third last, then fourth last. So this will be last in first out. So this is the mechanism of storing the element. So stack is a form of linear data structure where we can store the element in the last in first out fashion, last in first out. So these stacks are primarily used in solving the algebraic expression, algebraic expression and where we have to delay where we have to delay certain operation. Let us say I want that the operation B should be executed after a but b arrive before a. This time writing if I want operation b should be completed after a but b arrives before a. So, if b arrive before a and we want that b should execute after a then what we will do we will simply say use stack so stack will delay the operation because it say that the the the entity the program that will last in will be first out okay similarly um in queue if you remember so this is let's say the window of your uh theater okay or so here some persons are taking tickets so first three will be served then

four will be served then five will be served then six will be served and seven and when a new person come then it will be added here so that is called as the back and this is called as the front so from front the the processing will be done and from the rear the insertion will be done so here first in first out those who are first in the line other than those who are influential that we will talk in the priority queue so other than the execution will be normal the those who are in the front of the line will be get service first and afterwards other person will get the services and when a new thing will arrive it will be inserted on the last part so this data structure is called as the Q data structure that resembles the actual Q behavior and it follow the mechanism of first in, first out. This follow the mechanism of first in, first out. That is called FIFO. Now, I hope you can visualize. So, there are two other types that is a tree and graph and they are

non-linear. We cannot linearly store one after another. So, here this is an example of tree and for those this is first time, do not worry, we will cover almost around 10 or you can say five to six lecture on tree itself. So, we will explain all the aspects of the tree and for graph also we will see some algorithms. So, do not worry about that and graph also we will discuss in a detail how the data will be stored, how it will be managed, how it will be revoked, every aspects of this data structure we will see in the tree and graph separately. So, tree are basically the difference, both are non-linear, both are non-linear. The basic difference is that it does not have loop, have loop or you can say close boundary and this have loop or closed boundary. Sometimes we call as the tree is subset of graph because when we connect in graph, when we in tree, when we connect two nodes, so let's say if I just connect this thing,

so it become a closed loop, then it become a graph. So tree are the subset of the graph with a specialized feature that they will not contain any closed boundary or loop. But in case of graph, there is a certain that some close boundaries are there. This is a certain that some close boundaries are there. So, this is a primary difference, but while discussing the algorithm and other stuff related with the tree, we will again cover in the details. So, this is an example. So, first node is called as the root node and these are the left child and right child that we will discuss. And all the subtree is a tree itself, all the subtree is a tree itself. So, stack and queue I have already discussed, tree definition you can get from here. These are the simple example. And now, just give me a minute. Sorry for the interruption. Let me continue. So, now, we have discussed so far about tree, graph, stack and cube. And now,

why this data structure is coming into the picture? Because we have to perform these four operations. So these just remember, these are the four core operation in any data structure. Core operations in any data structure. So that is traversal, searching, insertion and deletion. So insertion means that adding new record, I guess in stack I can add new element in queue, I can add new element in linked list, in array, anywhere. So that is insertion. means that removing some element from pre-existing one. And searching means that we have to identify a particular record or key sometimes we say. Now traversal is another aspect. So traversal says, visit all the element or all the node at least once or here or exactly once. Visit for example, I had an array that has data 10, 20, 3, 4, 22. So when I say traverse, so I will go to all the element, note down its value and perform certain operation and come back.

So traversal means that accessing all the element exactly one. And when I do searching, so now search three, so I will directly identify search and declare it is available in the array or not. So, searching and traversal are the two different operation. Searching and traversal are the two different operation where target of traversal is to visit all the node exactly once in searching our target is to identify a particular record. And insertion means that adding new record and deletion means that removing the record that is pre-existing. Now, this is just a comparison table. Afterwards, I will take your queries further. So, basic difference if you talk about in linear and non-linear data structure is that elements are arranged sequentially or linearly and attached to one and another. Attached means that in array, they are directly attached. In linked list, they are attached via the address pointer. And in this structure, the elements are arranged hierarchically or non-linearly,

like these trees for me. So, this is an hierarchical arrangement of the element. Then type, array, linked list, stack, queue are the type of linear data structure, whereas tree and graph are the type of nonlinear data structure. So if you talk about the implementation, so due to linear organization, they are easy to implement. And nonlinear organization, of course, it will be difficult. Traversal as linear data structure is a single label. So it required a single run to traverse each data item. The data item in nonlinear data structure cannot be accessed in the single run it requires multiple run because one run this another this another this so hierarchically so number of runs will be more this already you know one attached to the previous and next each item is attached to many other items so you can check out so let's say this is a binary search tree so this is connected to this this is connected to this okay that is the

arrangement so label so data structures does not contain any hierarchy all the data elements are organized in the single label okay and in this data structure elements are arranged in multiple labels okay non-linear data structure memory utilization if you talk about so it's non-efficient because because in case of array if you remember when we need two element to be stored we are declaring 20 array so 18 spaces are wasted in memory it is utilizing very so we will see how the memory requirement is reduced significantly when we are using tree and graph on how this axis traversal insertion is very easy okay so time complexity of linear data structure increases with increase in input side that we will discuss okay in time complexity that is asymptotic analysis we will probably discuss in the next sunday class on saturday we will discuss about some more about algorithm and next sunday class we will talk about the asymptotic analysis of the

algorithm that is theta omega and um vigo and applications are mainly for developing software and other here so most of this ai algorithm that we are witnessing nowadays are non-linear one okay so graph graph networks and other you have heard about so that are non-linear so So let us do take our queries, then we will discuss on a real world algorithm we are targeting. So that is our journey from Patna to Delhi. Okay, let us take your queries. If you have any otherwise, the number of people are raising hand, yes, just provide access to them one by one, Anthony Satish J, you can ask your query because is raising 13 times. provide access to the case yeah because you can ask it out yes yes you are audible yeah I raised once I don't know why it's showing 13 times okay so my question is around the list because I use Python extensively for data engineering projects yeah and in python we can change the number of elements i mean in in list

we can change the number of elements at the run time so will it be is will it be a dynamic yeah yeah it is dynamic because in in python most of these are supporting dynamic arrangement so you can say it is a kind of dynamic it is not anywhere in python arrays they are all are primarily a dynamic type okay okay thank you yeah yeah you can ask it out okay next majit khan salim khan you can ask it out next sonam chanda you can ask hello sir can you hear me yes yes i can hear So regarding this, as you said in HackerRank, so I use HackerRank for my course and everything for my office work. So I want to know, like, as you said, either you can use Java, C programming, or Python. So if a person who is from different backgrounds, like many people have a project from different locations. so for those who like will they get some course like some fast track course like how to use java or how to use c program no worries so we'll explain all all the steps okay we will not

directly ask the question you write a program for this or do something for this we will explain all the step how the let's say insertion sort of works what are the input how each step we will write explain then ask you to do so that will be kind of a booster course for all those who are from non-CSC background or not doing work in this language. Okay, so don't worry about it. Labs are good. Okay, so another question. This linked array and stack, this I have learned during the class, college time index C programming. This also helps with the Python also? This actually works in dynamic range? Not directly, but as the previous person, I don't remember the name was asking, be uh business or because something so in python it offers the mostly the dynamic things so the area kind of stuff is not there so yeah yeah yeah sure thanks yeah you can ask your doctor um sir if you don't mind can i ask another thing it's a general question so about the attendance about

the attendance and about the schedule i want to ask this question so how the attendance is recorded like as you said given an example like if someone start the class and then just sleeps is and or if that person attends the class after 15 minutes or 10 minutes so how the attendance is recorded actually like actually um in in moodle we are working on the background there is moodle is running so what it did it take the uh is you can say record all the information let's say you at 8 or 8 15 and then three four time it record and then match out who are present throughout the class and then their attendance is marked but exactly what it happening i does not know but this this is the mechanism i have discussed long back so they told that each every 15 minutes they are taking the snapshots who are attending and accordingly they are managing for all four or five chances all the people people is available then is not present also also if someone for

example someone because as we are all working on professions so someday if like in monday or twisday if some classes are there and if you miss that classes and if you watch the recording won't that be recorded as that that person has seen it that in attendance no no there is no provision but there is no um you can say um you are allowed around if you are having present in 75 percent so that is allowed okay so that freedom you people are getting okay and sir about our schedule like there were the course details and everything so whatever syllabus that we are getting this also for 2024 so is there any revised uh curricula like syllabus where we can get for 2026 like someone has discussed that they have a doubt for electives so we know the elective options like these are the options which are available in the model but if you see the syllabus details then it will give us much more defined way like which were which uh subject to choose so is there

any way to get a revised subject? Okay, so you can reach to the, you can just search on the Google IIT Patna MTech curriculum, CSC curriculum, so you will find the... Yeah, that is given, sir, the old one, sir, 2024. No, no, that is not. In 2024, we have revised our entire curriculum, so it will be valid for six, seven years. Okay, that will be the same. Okay, sure. Thank you, sir. Thank you so much, sir. Sir, Parambhir is asking the PPT which you are using in the the class can we get it before the class started actually what happened is someday while preparing it it could be that in the late night i prepare it but i will try to add it beforehand okay but most i mean most of the cases the ppt is not ready with me so how can i share but i will try to do before one day i will upload the ppt okay next you can ask your doubt hey hello sir my question is about this graph you said the graph has closed boundary can you please explain that one

what exactly do you mean by the closed boundary yeah I am coming to you in the closed boundary I mean that if you see the tree A is attached to B B is attached to D but there is no second path of attachment Okay. And here 0 is attached with 1, 1 is attached with 4 and 4 is also. So this is a close boundary. Okay. This is a close boundary, but in 3, you will not find any close boundary. Getting? Okay. So you mean to say all the nodes are interconnected? All the nodes, not all the nodes, even if three nodes are connected and forming a triangular structure and others are like trees, then also it is a graph. Okay. Got it. Thanks. yeah yeah and next uh sabuch das you can ask it out uh hi sir uh good morning everyone uh hope i am audible so i have two queries uh so i want to know the difference between contiguous memory and non-contiguous memory i like somehow like if you can further clarify that will be helpful for me okay just taking a simple example let's say you had an almera

okay and you are having tens left uh selves okay one two three four five six seven eight nine ten and now what you have uh did let's say i want to uh use an array for storing my clothes and the array size should be five so what i will do i will acquire one two three four and five freaks and stored my clothes okay but let's say in your 10 space memory six uh locations like two three seven nine ten one are engaged and you want to store the array of size four so you cannot store because the the cells are not available in a contiguous order but linked list say i can store in the different different location so that is the best example to understand got it got it yeah one more query i have yeah so you are saying that uh like for data searches for areas we can do like uh traverse cell searching addition and insert a new record right yeah so you mentioned like we cannot array is basically static we cannot change the dimensions during the runtime so how does it

inserting a new record uh no no so uh what i say in your almira there are 10 spaces okay so i declare array size is 10. initially i store two elements and now i want to store another eight so that is allowed okay okay yeah okay okay got it so predefined if we are doing predefined uh declaration of the size then in that we can do insertion and deletion yeah got it got it so i was confused okay thank you uh sir there is one comment out that people are asking in at the initial class you mentioned one book now corman yes yes yes so how do we know that uh i will upload on the moodle okay i will upload a pdf file on the moodle don't worry okay next sanjay dhanka you can ask your doubt next gyan chand sharma you can ask your doubt this is first class so i'm taking uh these kind of doubts because hello if i take doubt in this manner so i can't continue but but no worries this is a first class so i am taking yes yes you can yes sir little bit be louder yes yes sir

foreign We are engaging our M.Tech student for 7-8 hours each day. Each day. You have to do like your Sunday and Saturday are engaged and even late evenings of Monday, Wednesday may be engaged. So that is the issue. This is customized for you people. This is customized for all hybrid people so that they can attend classes on Saturday and Sunday. Saturday and Sunday, okay. Thank you. okay next uh sanjeev kumar uh so uh one one common announcement i am making because uh those who are done because i'm not going to teach further so they can leave the meeting those who have queries still i'm i'm there to resolve for another five minutes okay and this is the first class so i'm taking queries like this but hope in the next class we are getting specific queries for the topic i'm with you yeah uh hi sir i hope uh i'm audible yes yes yes yes so my question is uh is the lectures enough to you know learn about uh data structure and algorithm and uh design because i

don't i might not have the time to you know read the books because my work is yeah yeah that's why i told my lectures and my what it is i will say that will be enough okay if you want an extraordinary thing to be done then you have to refer book otherwise the exam the quizzes other stuff will be will be done from my activities only oh okay thank you yeah yeah vertica you can ask it out debashish you can ask it out hello hello uh actually sir i want to know like how the marks will be translated uh on the header and like it will be like calculated to the of the questions or it will be like uh no partial partial partial marking we have already done so you will let's say some test cases are passes then then you will get from partial marks okay so don't worry about that in the later on i will decide how to take that marks of which lab i have to take so that will be in the favor of the students uh and also like during the orientation like someone has told me

like if i will not able to attend the live classes so if i will watch the recorded session yes yes yes attendance will be marked to recorded uh so that mechanism i don't actually aware of but i guess you people are more aware of that but i will ask the team what are the mechanism then i will let you know in the next lecture probably yeah anujay saraf you can ask it out so those who have done can leave the meeting because the lecture is done i'm just picking the doubts yep good morning sir good morning thank you so much for the wonderful informed session actually my query is regarding two two things very specifically one is as we are working professionals and we already kind of been informed that once you watch the recordings as well you will get the attendance so is it the same here or we are having any it is common for all the courses actually i don't know exact mechanism of how the attendance is captured when you are

viewing the recorded video but there will be a mechanism okay okay and second thing is sir as a request like uh we are getting the workflow while you're getting while you're giving the lectures right so you're using the ppt and you're writing the actual information as well like you are giving the annotations will it be possible to upload the similar ppt yes the same ppt i will upload annotated one i will upload yeah yeah because it has your written notes so that will help us to relate while we watch the recording again okay that will be available and any last thing sir because we are coming from say like as a background we are coming from electronics not from a cs itself so does it mandatorily to have some learning in terms of core of cc++ to understand no no that is not needed just attend the lab attend the lectures so after six months you will find the changes are there in because in our major ai industry that we are working on

i'm using python as my more glance yes that's where i'm just confirming uh whether it's required or not okay okay thank you thank you so much yeah yeah debashish you can ask your doctor you can unmute yourself and ask otherwise Tushar Raman okay otherwise I will take the queries in the lab so I guess we are running out of time I have another meeting scheduled at 10 so so we will discuss more in the detail lab session okay so today lab will be not will be kind of evaluation one it will show you how to run the hacker rank what are the questions how it will go and take your queries okay okay yeah thank you everyone um so we'll we'll see again in the lab okay devasis is raising okay devasis i can take your query

