 Hello friends, I am Sanjay Gokha. In this video, I am going to explain three different methods that we are going to implement with the help of these methods. So these three methods will be traverse, count nodes and calculate some of nodes. And all three methods will be related to central engineering. So I am going to tell you how you can implement these methods with the help of these methods related to this concept. So before starting, let me first create a link list. So suppose this is a start pointer, then we have first node. This is node number one, node number two. And this is node number three. Now these are values which are stored in these nodes. This is the base address of person which is stored here, base address of second node which is stored here and base address of third node which is stored here. And third node link part is containing node. So this way, this cellular address is connected, right? And each node is either divided into two parts. So if we see this node, so its first part is known as info and second part is known as link or next. And it will be a pointer, right? So if we traverse a particular link list, so we need to traverse each node. So now I am going to tell you how you can implement your first method to traverse a single link list, right? So before starting, let me first explain the structure. So if you create a link list, so first we need to create a structure. So right now I am telling you how you can create a structure for this node. So its first method will be info and its second method will be the node pointer link or here you can also write next. So what type of link you want to use, you can use. So we will be using link because in my algorithmic videos I also use link for this second part. So we will be preparing link and I am using this. So this is basically the structure that we use to create any node in the line. Right? So I hope you understood this how we can create nodes with the help of this structure. So if you want to create these nodes and you want to insert them, so for that purpose you need to watch my other videos that have been selected to insert elements into link list. But in this video we are going to focus only on these three ones. So now I am going to write first method. So it will be white traverse then structure node pointer start. So this method will be calling from the main function. And from main function we are going to pass this start. So start always contains base headers of the first node. So first node headers we will be passing from the main function and that will be received up with this start node. Right? Now through this start pointer we are going to traverse each and every node of this link. So now here I am declaring one more pointer. So structure node pointer PTR and I am assigning start into PTR. So PTR is also a pointer with no type structure node. So it will be containing the address. This is our input into start. So start will be passing 1001. So PTR will be pointing to 1001. So here I am creating one more pointer whose name is PTR and PTR will also be containing 1001. It means PTR is pointing to this node. Right? Now I am implementing a loop while PTR node equals to none. So if PTR is not equal to none then only this loop will be executed. Otherwise it will be permanent. So now inside this loop. So we are going to implement the function called Traverse Olympias. So in case of Traverse I am going to print the values which are available in this input part of the loop. So for that purpose I am going to print a backslash P for Cinti. Now here you need to case we see this. Whenever you access any number of structure through structure pointer. So PTR is a structure pointer. So you need to use this arrow notation. So I am going to use PTR arrow and here I am adding input and then start. And then PTR equals to PTR arrow. So this loop is completed and I am using this method here. So now I am going to explain each and every step better in this loop how it will be executed. So starting from here PTR is going to start. So PTR is starting from 1001. So it is pointing to 1001. Then check this condition PTR not equals to 1002. Then print PTR info. So this notation is arrow. So if you want to type this in the program. So first you type iPhone and then the other side. So by pressing these two keys you will be typing this arrow notation. So PTR is a pointer. And through pointer we are going to access info part of the node. So node info part is 10. That I already explained you with this data. So what will be printed on output is the 10. So first output will be 10. Then PTR equals to PTR link. So PTR is pointing to 1001 and 1001 link part is containing 2001. And that will be stored into PTR. So new value of PTR will be 2001. It means now PTR is pointing to this loop. So whenever you want to jump from one node to another then you need to type this in C program. So now PTR is pointing to second one. Check why PTR not equals to 1002. So PTR will be printing its information. So right now PTR is pointing to 2001 and its information part is 20. So next output will be printed as 20. And here we are using backslash key. So backspace will be there between these two values. If you want to print that in second line then you can use backslash and in case of backslash key. Now again PTR equals to PTR link. So PTR is pointing to 2000 address and at this position link value is 3001. So this kind of PTR will be having new value as 3001 and PTR is pointing to 1001. So this way I hope you understood how this loop is working. So again we need to check this partition PTR also has this loop. Then PTR will be printed. So right now it is 30. So 30 will be printed. Again PTR will move to link of PTR. So this time PTR is pointing to 3001 and its link is having value. So this time PTR will be having value. Now check this partition because false because PTR is equal to null. So where it will be false, loop will be connected. And here you can see all three values which are available into these separate nodes are printed on output screen. So this way I explain how we can implement a function in C language that will traverse each node of a cylinder. And this is the structure through which you can create nodes. So how this structure will be so that you can understand why you will be watching the video related to how we can insert a loop into a link. So that video is also available in the playlist. So if you want to watch algorithm video, if you want program implementation, you can see related video and actual code implementation with the help of any compiler. So all video related playlist are available in description of this video. So if you go to the description of this video, you will find various links of playlist. So you can open them and you can search the videos related to link. So you can watch all kind of videos. Like how to implement algorithm, how we implement those variables with the help of C program and how these programs are implemented on compiler actually. So after this traverse, now I am going to tell you about the count nodes. So we will be converting this code only. So here I am going to declare one more variable that is C equals to 0. Different type of this method will be named. Name of this method will be found and instead of printing values, I am going to write C plus. So this loop will repeat whenever PTR is not equal to null and PTR will be null when it will be reaching to the end node. So this way this loop will count each and every node. So whatever the value of count will be, so after completion of this loop, you can return value of C to main function. So again main function will be calling this count function and will be passing the value which is available at the start pointer. That will be stored in this start pointer into this function. Then we are assigning it into PTR. Through PTR, we are rotating the loop and counting how many inputs have come. And after completion of this loop, we can return the value of C to the main function. So I hope you understood how easily we modified the traverse function into count-node function. So the second is also completed and now I think you can easily write the function for some of node values. So we need to add and keep that together so that we can print the sum of information which are available in each node of single input. So what we need to do? I am declaring variable S equals to 0 and here I have to write S equals to S plus PTR info. So whatever value is available into PTR info. So PTR will be pointing to a particular node and each node is having information part. So that info will be attributed to S and will be stored into S variable. And after completion of the loop, sum will be attributed to S and you can return value of S. And instead of writing count, we are using sum. So friends, this way I explain you all the methods that we can write with the help of C language code. And I also explained how we can write algorithms related to these three topics. How to traverse languages, how to come through, how to calculate some of them. So if you want to watch how we can write algorithms for these points related to singular languages. So again I am telling you you can go to description, find the playlist links and watch videos related to languages there. So I hope you understood whatever I explained in this video. Thank you for watching this video.