 Hello friends, I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I am going to explain three methods based on traverse, insert and delete operation on criteria and those are related to data structure and algorithm implementation within sea language. So if you want to watch algorithms on all three operations, so for that you can go to the description of this video and you can find a link of playlist related to data structures and algorithm. Also programs, those are implemented using sea related to DS. So first I am going to implement a method that will be doing traverse operation on criteria. So the type is void, name of method is traverse and it will be listening to arguments. First is array and second is its size. So now with the help of this size, we can display all the elements which are available into this array and this method will be called by the main function. So from main function, we are going to pass any edit size. So I am declaring one variable i that I am going to implement a loop. So it will start from zero and it will go up to lesser end and inside this loop, I can bring value of array using k of i. So this way, this is a simple implementation how we can upgrade elements of array one by one that is known as traversing loop and right. So this implementation is using sea. So here I have explained you like how we can implement any of the key language. So I hope you understood this. Now I am going to explain second one that is related to insert operation. So that is second operation. So right now we are going to understand how we can insert an element on a particular position of word here. So return type event function will be insert and it will be having total four arguments. So first is array, second is size, third is the position where we want to insert the element and fourth will be the item that we want to insert. So these four parameters will pass from the main function. So now I am going to declare one variable that is i and it will be having value as n minus 1. Now I am going to implement a value. So here I am going to check this condition. If i is greater than equals to k, then this loop will repeat. So here n is total size of array, k is the position where we need to insert an element and item is the value that will be inserted. So now with this I am going to shift the current position of current value of array to the next position so that the required position can be black and it can insert a new item. And here I am implementing it. After completion of this loop, I can write p of k equals to item and equals to n plus 1 and I am returning the modified size of array. And remember one thing, this array we did it because whenever this insert function will be called from main function. So main will be passing an array that will be received into this array and then see that if you modify the array in a particular function. So the color of the function array will be modified automatically. So here in this insert function we are going to modify this array. So the main function array will be modified automatically. So we just need to return the modified size of array. Now let's understand it in an example. So let's say this is our array and these are five elements. Those are already stored in the array. So now I am going to take a value. So let's say size of array is 5. So n is 5. 8 is 2. Item that we are going to insert is 20. So now starting from this first step, so i will be n minus 1. So value of i will be 4. Check this condition. It is 2. 4 is greater than equals to 2. So a of i will be assigned into a of i plus 1 position. So i is 4. So a of 4 position value will be assigned into 5th position. So it is shifted to one place. Then i will be incremented. So it will be 3. 3 is greater than equals to 2. So a of 3 position will go to a of 4 position. So 14 will go there. So 14 is also shifted. Now i will be decremented. So i is 2. So 2 is greater than equals to 2. Condition is again 2. So a of 2 position will go to a of 3. So 13 will shift here. And i will be decremented. So this time i is 1. So this condition is false. After completion of this loop, a of a position will be added item. So a of a is 2. So this second index will be adding new value that is 20. So all three values are shifted to right inside so that we can insert the value on this position. And after inserting all, sorry after inserting that particular value, you can see initially size of that was 5 and right now the size of that is 6. So that's why we incremented it by 1 and we have ended up with 2 being false. That will be calling this insert problem. So this way i hope you understood how we can implement insert function with the help of C language. And if you want to watch how we can write algorithm related to insert operation. So again go to description of this video. You will find a link of playlist that is data structure and algorithm. So in that playlist you will find one video related to implementation of traverse insert and delete algorithms related to what the end. Now after this implementation, next is deletion. So now we need to understand the deletion function. So that will be the third. So in case of deletion again we need to write this method. So written type is in function name is delete and again delete function will be having 4 parameters. So first is adding. Second is size. Third is the position from which we need to delete the element and fourth is either in which we will be storing the deleted element. So here first of all i am going to declare variable in which i am assigning a value of k that i am writing while i so condition will be while i less than n so inside this loop i am going to write this that E of i equals to so if i will be having E of i plus 1 value so this time you can see we are inserting right hand side value to the left hand side position and here i am writing i plus this right and we can like n equals to n minus 1 and return n and if you want to store that element that is deleted so here you can write item equals to k of k so the k position element will be stored into item and let's say you want to show a message print as backslash n or simply is deleted and you can print it like this so the value of item will be listed here so the value is deleted message will be hidden so this way it is implemented now i am taking example so this was the edit that we created after insertion 20 was there so now we need to pass these values so let's say and fix k is 2 and item will be even when we start here start from here so i will be equals to k so it will be 2 then item will be equals to a of k so a of k is 20 so item will be having 20 so if i is less than n so value of i is 2 so a of i plus 1 will be assigned to a of i position so i is 2 so this position will be raised as its next element will be assigned here so this time we are shifting elements from the right side to left side then i will be implemented so it is 3 again it is 2 so a of 3 position will be having a value which is available on a of 4 position so it will be shifted here then again i will be implemented so this time i is 4 so 4 is again less than n so a of 4 will be having value of a of 5 position so this will be shifted here and i will be again implemented so i is now 5 so 5 is again less than 6 so a of 5 will be having value of a of 6 position so here we need to put n minus 1 because right now we can see value of i is 5 so if we take n as 6 so one more rotation will be formed so it will be shifting this position value to here so here you can put n minus 1 so it will be 5 right now i is 5 so 5 less than 5 will be 4 then you can decrease actual value of n so it will be 5 and this print tab will be printing value of item that is 20 so 20 is needed so here you can see right now we need this so n is reduced to 5 so total 5 will be here so new value of n will be returned to the main function and whenever this modified n will be printed so in that case the average will be printed total 5 will be 6 so this is basically the problem of n the physical notation is not we need to measure the increase both in case of insert and delete operation so with this way i hope you understood how we can define methods related to traverse insert and delete operation and if you want to watch how we can implement their algorithms so go to description of this video so you will find a link of playlist that is to write data structures and algorithm so watch those videos so that you can understand how we can write algorithms and this was implementation of those algorithms with t-language so i hope you understood whatever i explained in this video thank you for watching this video