LINKED LIST (INSERTION AT BEGINNING,ENDING,SPECIFIED POSITION ) - DATA STRUCTURES

  Рет қаралды 177,692

Sundeep Saradhi Kanthety

Sundeep Saradhi Kanthety

Күн бұрын

Пікірлер: 146
@RidwanurRahmanextreme
@RidwanurRahmanextreme 4 жыл бұрын
Sweat dripping off your neck is priceless for us.
@bachalakurisumathi5211
@bachalakurisumathi5211 2 жыл бұрын
sir your teaching is very understanding to students. iam also faculty,i v'l follow ur video. its very usefull to my teaching.
@manishag100
@manishag100 4 жыл бұрын
Link list was very well explained i really liked it a lot.
@swapniljaiswal4956
@swapniljaiswal4956 5 жыл бұрын
I wrote the full program down here: #include #include int value; struct node { int data; struct node *next; }*new,*head,*tail,*temp,*current,*prev,*next; void create() { new=(struct node*)malloc(sizeof(struct node)); printf("Enter the value: "); scanf("%d",&value); new->data=value; new->next=NULL; } void insert() { create(); if(head==NULL) { head=new; tail=new; } else { tail->next=new; tail=new; } display(); } void display() { printf("Updated link list is: "); temp=head; while(temp!=NULL) { printf("%d ",temp->data); temp=temp->next; } } void insertatbeg() { if(head==NULL) printf("No Linked List found."); else { create(); new->data=value; new->next=head; head=new; display(); } } void insertatend() { if(head==NULL) printf("No Linked List found."); else { create(); new->data=value; tail->next=new; new->next=NULL; tail=new; display(); } } void insertatmid() { if(head==NULL) printf("No Linked List found."); else { create(); temp=head; int pos,i; printf("Enter the position where new node is to be inserted: "); scanf("%d",&pos); for(i=0;inext; } new->data=value; new->next=temp->next; temp->next=new; display(); } } void deleteatbeg() { if(head==NULL) printf("No Linked List found."); else { temp=head; head=head->next; temp->next=NULL; display(); } } void deleteatend() { if(head==NULL) printf("No Linked List found."); else temp=head; while(temp->next!=tail) { temp=temp->next; } temp->next=NULL; tail=temp; display(); } void deleteatmid() { if(head==NULL) printf("No Linked List found."); else { temp=head; int pos=0,i; printf("Enter the position which you want to delete. "); scanf("%d",&pos); for(i=0;inext; } temp->next=temp->next->next; display(); } } void count() { if(head==NULL) printf("No Linked List found."); else { int count=0; temp=head; while(temp!=NULL) { count++; temp=temp->next; } printf(" Total number of nodes is : %d ",count); } } void reverse() { if(head==NULL) printf("No Linked List found."); else { current=head; while(current!=NULL) { next=current->next; current->next=prev; prev=current; current=next; } } head=prev; display(); } int main() { printf("Press: 1.Insert a new value. 2.Display all elements. 3.Insert at beginning. 4.Insert at End. 5.Insert in middle. 6.Delete at beginning. 7.Delete at End. 8.Delete in between. 9.Count total number of nodes. 10.Reverse 0.Exit"); int choice; do { printf(" Enter your choice: "); scanf("%d",&choice); switch(choice) { case 1: insert(); break; case 2: display(); break; case 3: insertatbeg(); break; case 4: insertatend(); break; case 5: insertatmid(); break; case 6: deleteatbeg(); break; case 7: deleteatend(); break; case 8: deleteatmid(); break; case 9: count(); break; case 10: reverse(); break; case 0: printf("Exited successfully"); break; } }while(choice!=0); }
@madcrispy321
@madcrispy321 4 жыл бұрын
SWAPNIL JAISWAL bro apne tail ko traverse kiya he nhi na
@083_subhamsaha2
@083_subhamsaha2 3 жыл бұрын
Error is coming can you please help?
@nithinkumar7156
@nithinkumar7156 2 жыл бұрын
Send doubly linked list and circular linked list code
@ashokkumarmajji6158
@ashokkumarmajji6158 Жыл бұрын
#include
@AtharvaMalikVlogs
@AtharvaMalikVlogs Ай бұрын
Nice bro
@sondos23-t5c
@sondos23-t5c 8 ай бұрын
Thank u so much. The explanation is very simple. I hope it will be translated into Arabic🔥 in the future. Continue, u deserve the best 👌🏼
@supratimnayek2776
@supratimnayek2776 5 жыл бұрын
I think the loop will be (i=0;i
@supratimnayek2776
@supratimnayek2776 5 жыл бұрын
or i
@sagardixit8432
@sagardixit8432 4 жыл бұрын
@@supratimnayek2776 pos-1 coz you are initializing i to zero
@parvathakumaransevaiya423
@parvathakumaransevaiya423 4 жыл бұрын
Insertion at ending 10:18 Insertion at specified position 14:28
@swathy9088
@swathy9088 3 жыл бұрын
So kind of u❤️ Since I only want to watch insertion at position
@jaydipmakwana7696
@jaydipmakwana7696 5 жыл бұрын
Thank you so much sir,i can understand link list easily.
@jagadevaas9169
@jagadevaas9169 5 жыл бұрын
Sir need an implementation part..! U teach in very easy method, but still implementation would help us to understand more better...! Thanku
@srikalyani9089
@srikalyani9089 4 жыл бұрын
Yesss
@fluffy280
@fluffy280 11 ай бұрын
struct node{ int data; struct node *next;//self referential pointer it points to itself useful for creating new nodes }; int main(){ struct node *head=NULL,*tail=NULL,*new,*temp;//variables to acess our structure int value; char ch; //node creation do{ new=(struct node*)malloc(sizeof(struct node));//allocating the memory for our node printf("enter any value: "); scanf("%d", &value); new->data=value;//assigning the value to node new->next=NULL;//initially setting the 1st node to null if (head==NULL){//condition1. checking if the list is empty if it is setting the node created as head and tail and next as null head=new; tail=new; }else{//2.condition.if node already present linking the created node to tail and setting it as tail tail->next=new; tail=new;//setting new node as the new tail } //to check if the user wants to create another node printf("do you want to continue to create another node if yes enter (y( if no enter (n): "); scanf(" %c" , &ch); //inside of using fflushstdin leave some space before % symbol to avoid buffer memory }while(ch=='y'); temp=head; while(temp != NULL){ printf("%d" ,temp->data); //always use arrow not dot when aceesing a member in the structure which is of pointer if (temp->next!=NULL){ printf("------>"); } temp=temp->next; } //allocation memory struct node *freePointer=head; while (freePointer !=NULL){ struct node *nextNode=freePointer->next; free(freePointer); freePointer=nextNode; } return 0; }
@subhanullahdanish8680
@subhanullahdanish8680 2 жыл бұрын
i really understand sir very very thanks from your teaching method
@nagasundar8121
@nagasundar8121 3 жыл бұрын
Sir if u don't mind can I correct the error in the last code that's means insertions of list at specific position in that ,, the for we had written is wrong ;; that is (i=0;i
@usmaanrangrez3445
@usmaanrangrez3445 2 жыл бұрын
but if we write pos code doesn't work!
@just_believer
@just_believer Жыл бұрын
Sir wla insert at specific position shi h ki nhi aur agr nhi h to dhi wla bhj dena
@just_believer
@just_believer Жыл бұрын
Ye insert at specific position shi Hain kya bro aur glt hai to shi wla bhj do
@princesubhash2421
@princesubhash2421 4 жыл бұрын
tq sir it is very useful and i am a student of lbrce cse
@singireddyvenkatameghanath9785
@singireddyvenkatameghanath9785 5 жыл бұрын
Data structures is the important for the cse students
@veerakumarn739
@veerakumarn739 3 жыл бұрын
yes, it is very important to all those who are performing with the elements...And if you want to reduce the time complexity and memory occupation it will help you a lot
@mickyman753
@mickyman753 3 жыл бұрын
that for loop of any position gives same result for both 0 and 1index ,so we should change it else if we wanted to insert at beginning or at index 1 with any position function will lead to same result ,i.e. insert at index 1
@esakkiram8999
@esakkiram8999 3 жыл бұрын
really interesting class sir and nice understanding thank you sir
@tharunnayak14
@tharunnayak14 4 жыл бұрын
TEACHING BETTER THAN IIT PROFESSORS. U ROCK SIR
@BiqSam2002
@BiqSam2002 4 ай бұрын
I'm in a right place...thanks sir
@haniawanhaniawan8638
@haniawanhaniawan8638 5 жыл бұрын
thanks for a such easy way of understanding link list
@sudhanshusharma28
@sudhanshusharma28 5 жыл бұрын
Sir can we write this steps in algorithm on beginning,ending and specific position tell me sir plzzzzzzzzzz
@harshakumarnomula6648
@harshakumarnomula6648 5 жыл бұрын
super explanation sir ,Thank you so much sir
@virendragarje6009
@virendragarje6009 Жыл бұрын
Best explanation 👍
@shraddhakasaudhan3972
@shraddhakasaudhan3972 4 жыл бұрын
Best explanation 🙏🙏
@khushibhatia4678
@khushibhatia4678 3 жыл бұрын
I really appreciate your efforts♥
@dpavankumar5138
@dpavankumar5138 4 жыл бұрын
👏👏👏👏 Sir, please explain with program U are explaining directly by assuming pointers Many programs are available at websites
@muhammadahmadyousaf2824
@muhammadahmadyousaf2824 4 жыл бұрын
the trick is to learn the algo understand it ... then perform it using any language you want.. for me i like java and C#
@sarialail
@sarialail Жыл бұрын
you are the best sir
@christiankassab988
@christiankassab988 2 жыл бұрын
Great video! Good job
@yogeshdeolalkar5326
@yogeshdeolalkar5326 4 жыл бұрын
Good explanation
@srinivasulupulijala8265
@srinivasulupulijala8265 4 жыл бұрын
Without execution its nothing!
@rakeshdebata5060
@rakeshdebata5060 4 жыл бұрын
Well explanation sir and thanku so much for this 👍👍🙏🙏
@dipukanchan3312
@dipukanchan3312 5 жыл бұрын
Thanks sir...very good explanation
@saddishpillay1097
@saddishpillay1097 4 жыл бұрын
Super sir..u teaching nyc
@carsfromgarage2905
@carsfromgarage2905 Жыл бұрын
Excellent👍
@DilleswaraRaoAmballa-br2zp
@DilleswaraRaoAmballa-br2zp 3 ай бұрын
insertion at specific position value =34 but the position is 3
@humanplanet8728
@humanplanet8728 5 жыл бұрын
Sir, I couldn't understand the statements written inside of for loop, in the case of specific position.. could explain it to me here in comment, it's quite confusing. It'll be a big help. Also the i value is not used in the body of loop, The iteration will happen only once so why? Please clarify my doubts, I the more I see the explanation in video the confused I get! Please help.
@farabimahbub5910
@farabimahbub5910 5 жыл бұрын
only the first statement is inside the for loop(that is why sir did not use parenthesis). The loop runs until we get to our desired position(pos-1)
@just_believer
@just_believer Жыл бұрын
​@@farabimahbub5910insert at specific position algorithm shi h
@anshumanmishra2555
@anshumanmishra2555 4 жыл бұрын
#include #include struct node { //Structure named node to store integer in variable data and a pointer variable which can store address location of next node int data; struct node *next; }*head; void insert(int data) { //This function will insert a new node to the start of the linked list struct node *temp = (struct node*)malloc(sizeof(struct node)); temp->data=data; temp->next=head; head=temp; } void delete() { struct node *temp; int loc,len,i=1; printf("Enter the location"); scanf("%d",&loc); struct node *p=head; while(inext; i++; } struct node *h=p->next; p->next=h->next; free(h); } void display() { struct node *temp=head; if(temp==NULL) { printf("The list is empty"); } else { while(temp!=NULL) { printf("%d->",temp->data); temp=temp->next; } } } int main() { head=NULL; insert(1); insert(2); insert(3); insert(4); insert(5); insert(6); display(); delete(); display(); return 0; }
@shrutishrinetra
@shrutishrinetra 4 жыл бұрын
Best explaination
@upenderguguloth5954
@upenderguguloth5954 3 жыл бұрын
Excellent sir
@ipirates3449
@ipirates3449 5 жыл бұрын
Sir u are too good.amazing
@vidhyamanoharan9191
@vidhyamanoharan9191 2 жыл бұрын
Thank you so much sir😊
@srikalyani9089
@srikalyani9089 4 жыл бұрын
I think there is a mistake at entering a new node at a specified position can u clarify it for me???
@bhanuprasadbaddam146
@bhanuprasadbaddam146 4 жыл бұрын
will write algorthim for it sir,for better explanation
@code_programme
@code_programme 4 жыл бұрын
Sir I think in insertion at ending tail->next=new should come first followed by new->data=value and new->next=null.Correct me if I am wrong.
@dharanipriya2390
@dharanipriya2390 4 жыл бұрын
Yes,correct
@pvssandeep2836
@pvssandeep2836 3 жыл бұрын
@@dharanipriya2390 i think those 3 can be written in any order
@Sanatani-c1t
@Sanatani-c1t 5 ай бұрын
Please anyone tell is this course is comleted and also for C langauge
@kasamadhu3509
@kasamadhu3509 3 жыл бұрын
sir malloc gives contiguous memory locations,why we are taking different adresses for each node , if we add new+size of struct node we will get right adress for another node they are contiguous na,
@AkashKV-ne8wi
@AkashKV-ne8wi 2 ай бұрын
Sir, i did not understand, insertion at specific position, what i didn't understand is, why did we initialise temp=head, temp=temp of next and why did we declare temp? Please help me sir...
@globe2929
@globe2929 4 жыл бұрын
Applications of linked list topic pettandi sir
@shraddhakasaudhan3972
@shraddhakasaudhan3972 4 жыл бұрын
thank you sir
@sameershaik8657
@sameershaik8657 3 жыл бұрын
types of linked lists explanation sir
@srikalyani9089
@srikalyani9089 4 жыл бұрын
If we r moving temp to temp->next then why don't we use temp of prev ,for entering adress of new node to 1 position
@niharikak8710
@niharikak8710 4 жыл бұрын
Sir please explain the program on single linked list
@govindasharma9077
@govindasharma9077 4 жыл бұрын
Great
@harshchoudhary9986
@harshchoudhary9986 4 жыл бұрын
Sir while writing the code plz write on side what value,new,temp denotes it's a bit confusing
@srinivasraosangamreddy5674
@srinivasraosangamreddy5674 3 жыл бұрын
👌
@R_sravani
@R_sravani 5 жыл бұрын
Thanku sir I have a doubt that y we. Wrote POS -1 mean what
@shibili2332
@shibili2332 5 жыл бұрын
It is to get the correct position that is the new node will come after position 1,so the new node will be at position 2. If we change the condition to i
@singlegirlchallenge2162
@singlegirlchallenge2162 3 жыл бұрын
Sir initially there is no elements in list then how to insert a new element at begging
@QuranicMoments
@QuranicMoments 3 жыл бұрын
Thnx a lot 👍
@peddadoddisunilkumar696
@peddadoddisunilkumar696 4 жыл бұрын
Hai sir can we get some programs for this concept can we get some link
@kowshikk1375
@kowshikk1375 3 жыл бұрын
Sir,I have a dought [if we want to create a array of 40 elements we run a for loop to reduce the size of the code and to save memory but when it comes to linked list if we want to create a linked list of 40 nodes then can't we use a for loop to create linked list so that we can reduce the size of the code]
@usharanitummala3106
@usharanitummala3106 2 жыл бұрын
why cant u use a for loop u definetly can use a for loop..!!!
@hanscesa5678
@hanscesa5678 4 жыл бұрын
Do u still create test cases for insertion at specific positions? (i.e, it has to be part in the list.)
@suhild4579
@suhild4579 3 жыл бұрын
Thank You ❤️
@gouthamireddy6450
@gouthamireddy6450 5 жыл бұрын
Hai sir, Linked list representation and Linear list representation, are both are same, if not what is the difference, can u explain sir?
@veeralakshmimuddana5831
@veeralakshmimuddana5831 4 жыл бұрын
Nice classs sirrr
@eswargunda3852
@eswargunda3852 2 жыл бұрын
Teaching part is best... Take care about the damn light 💡💡 sir... The board is not visible clearly sometimes
@thhummim3123
@thhummim3123 3 жыл бұрын
you are 1st
@jithukumar9996
@jithukumar9996 3 жыл бұрын
Tq soo much sir
@ravinandan1345
@ravinandan1345 3 жыл бұрын
Are you from Machilipatnam
@sundeepsaradhi
@sundeepsaradhi 3 жыл бұрын
Yes
@Vishuu196
@Vishuu196 4 жыл бұрын
Sir at ending we can put any number suppose we can put 10 2000
@ashutoshsingh4737
@ashutoshsingh4737 5 жыл бұрын
thank you very much sir
@ThankGod143
@ThankGod143 5 жыл бұрын
Trace the loop and explain that will be helpful its really confusion statements should be inside r outside the loop please clarify it...
@arastusharma439
@arastusharma439 5 жыл бұрын
Only one statement will be inside the loop ! The first statement!
@inzamamulhaque9198
@inzamamulhaque9198 4 жыл бұрын
What is the type of temp variable in specific insertion part
@balakrishnana.k3293
@balakrishnana.k3293 4 жыл бұрын
It is temporary variable.. we can't go with head always BECAUSE head always pointing first node of entire list .. so in order to tracking the nodes we have to use temp as temporary
@gamerdon6
@gamerdon6 3 жыл бұрын
Type of temp variable is STRUCT node same as head or tail
@gamerdon6
@gamerdon6 3 жыл бұрын
@@balakrishnana.k3293 you were not even answering wt he asked lol
@keysangyonthan
@keysangyonthan 5 жыл бұрын
how will the PC know what position is 2? we haven't assigned anything particular in order to calculate the length of LL
@anantsharma6699
@anantsharma6699 5 жыл бұрын
like in array indexing, the comp is able to know the indices of linked list as well. And indexing starts from 0.
@sudhirverma7082
@sudhirverma7082 5 жыл бұрын
great
@srikalyani9089
@srikalyani9089 4 жыл бұрын
What's the difference between linked list and single linked list????
@balakasandeep3882
@balakasandeep3882 Жыл бұрын
❤❤❤
@mussadiquejakati4840
@mussadiquejakati4840 5 жыл бұрын
Thank You So much !!
@jagadheeswarikolli2848
@jagadheeswarikolli2848 5 жыл бұрын
Tnq sooo much sir
@renujhamnani9417
@renujhamnani9417 5 жыл бұрын
Sir we are making *head and *tail variables but how will the compilor undersrtand that head is first element and tail is the last element ?
@keysangyonthan
@keysangyonthan 5 жыл бұрын
watch the previous video, we point to head to new(the first LL) and then don't change it, while changing the tail simultaneously as we add more nodes.
@santhoshkondaveni39
@santhoshkondaveni39 Жыл бұрын
sir this program not run in online gdb. suggest any ide other than turbo c.
@indianlegendking9071
@indianlegendking9071 5 ай бұрын
Sir, for second iteration condition fails so how can we do?😢😢😢
@rku5350
@rku5350 3 жыл бұрын
Sir kuch classes hindi me diya kro
@sahalcheruvadi1954
@sahalcheruvadi1954 5 жыл бұрын
Thanks
@bilalabida8291
@bilalabida8291 5 жыл бұрын
Thank you 🙏
@kirank6586
@kirank6586 5 жыл бұрын
What is a Generalized Linked List
@venu5416
@venu5416 5 жыл бұрын
Thanks sir
@sushanthreddy512
@sushanthreddy512 4 жыл бұрын
sir please provide the full code
@vinothvk2711
@vinothvk2711 5 жыл бұрын
Stament should be in outside for loop???
@farabimahbub5910
@farabimahbub5910 5 жыл бұрын
just the first statement will be inside the loop(which is why he did not use any parenthesis)
@arastusharma439
@arastusharma439 5 жыл бұрын
Its obvious 😜!
@anishjay3359
@anishjay3359 3 жыл бұрын
Tq
@-PAUL-ub3bz
@-PAUL-ub3bz 3 жыл бұрын
sir intlo AC pettiyandi
@syagamreddysrilakshmi6707
@syagamreddysrilakshmi6707 5 жыл бұрын
Head = new can you explain once sir
@keysangyonthan
@keysangyonthan 5 жыл бұрын
head points to new
@shahsikalagowda183
@shahsikalagowda183 Жыл бұрын
Or pls share the code in description link
@nikhilamadhamshetti8893
@nikhilamadhamshetti8893 2 жыл бұрын
Sir say circular double linked also
@allennamdeo3802
@allennamdeo3802 4 жыл бұрын
I suppose You should say "data of new" instead of "new of data"..🤔🤔
@Sahasb360
@Sahasb360 4 жыл бұрын
No its syntax is that way!!
@kollunageswarrao5179
@kollunageswarrao5179 3 жыл бұрын
Is datastructures in c and in python are same?
@hemanthsai
@hemanthsai 4 жыл бұрын
Telugu lo kuda cheppandi bro
@abinashcreation5575
@abinashcreation5575 4 жыл бұрын
Sir , insertion should not completely understand
@shahsikalagowda183
@shahsikalagowda183 Жыл бұрын
Sir implementation
@abhishekkushwaha1509
@abhishekkushwaha1509 5 жыл бұрын
Sir if speak in hindi then your videos will be unbeatable
@malothvenkanna4666
@malothvenkanna4666 4 жыл бұрын
Hai sir l want insert and delete linked list full program only plz sir
@fatimamasroor4904
@fatimamasroor4904 5 жыл бұрын
You speak about something and point to some other place on board
LINKED LIST (DELETION FROM BEGINNING,ENDING AND SPECIFIED POSITION) - DATA STRUCTURES
21:32
LINKED LIST (CREATION AND DISPLAY) - DATA STRUCTURES
42:19
Sundeep Saradhi Kanthety
Рет қаралды 370 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,4 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 16 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 89 МЛН
Learn Linked Lists in 13 minutes 🔗
13:24
Bro Code
Рет қаралды 347 М.
CIRCULAR LINKED LIST (CREATE AND DISPLAY) - DATA STRUCTURES
19:42
Sundeep Saradhi Kanthety
Рет қаралды 63 М.
Data Structures Explained for Beginners - How I Wish I was Taught
17:06
Internet Made Coder
Рет қаралды 598 М.