Application of Linked List (Addition of Two Polynomials)

  Рет қаралды 229,819

Neso Academy

Neso Academy

Күн бұрын

Пікірлер
@sumitraj6878
@sumitraj6878 Жыл бұрын
the perfect teacher... one with perfect pronunciation, perfect ppt, perfect voice, perfect everything, perfect what not??? huh? everything is awesome!!!!
@dipeshjaswani8142
@dipeshjaswani8142 3 жыл бұрын
sir, I am a first-year engineering student and have been watching these videos for 3 months and I really understanding the concepts in-depth thank you for such wonderful videos. Sir, I only request you to increase the frequency of videos so we can learn all the concepts cause there is no teacher better than you.
@manojkrishna5137
@manojkrishna5137 2 жыл бұрын
Ice chey ayitha
@roshansangamreddi3149
@roshansangamreddi3149 2 жыл бұрын
@@manojkrishna5137 🤣🤣🤣🙌🙌🙌
@lostinpeace190
@lostinpeace190 2 жыл бұрын
You better not to study engineering bro You are not suitable for engineering
@manojs6043
@manojs6043 2 жыл бұрын
Source code: #include #include struct node{ float co; int expo; struct node* link; }; struct node* insert(struct node* head,float co,int expo) { struct node* temp=malloc(sizeof(struct node)); temp->co=co; temp->expo=expo; temp->link=NULL; if(head==NULL || head->expolink=head; head=temp; } else { struct node* temp1=head; while(temp1->link!=NULL && temp1->link->expo>=expo) { temp1=temp1->link; } temp->link=temp1->link; temp1->link=temp; } return head; } struct node* add(struct node* head,struct node* head1) { struct node* temp=head; struct node* temp1=head1; struct node* head2=NULL; while(temp!=NULL && temp1!=NULL) { if(temp->expo==temp1->expo) { head2=insert(head2,temp->co+temp1->co,temp->expo); temp=temp->link; temp1=temp1->link; } else if(temp->expo>temp1->expo) { head2=insert(head2,temp->co,temp->expo); temp=temp->link; } else if(temp1->expo>temp->expo) { head2=insert(head2,temp1->co,temp1->expo); temp1=temp1->link; } } while(temp!=NULL) { head2=insert(head2,temp->co,temp->expo); temp=temp->link; } while(temp1!=NULL) { head2=insert(head2,temp1->co,temp1->expo); temp1=temp1->link; } return head2; } struct node* create(struct node* head) { int n,expo; float co; printf("Enter the number of terms: "); scanf("%d",&n); for(int i=0;ico,ptr->expo); ptr=ptr->link; if(ptr!=NULL) { printf("+"); } else printf(" "); } }
@sankhadip_roy
@sankhadip_roy 2 жыл бұрын
Thank you bro...
@dhiraj8641
@dhiraj8641 2 жыл бұрын
Appreciated 💯🙏
@abudardamallik1651
@abudardamallik1651 Жыл бұрын
struct node* temp=malloc(sizeof(struct node)); change struct node* temp=(struct node*)malloc(sizeof(struct node));
@codeheroesofficial
@codeheroesofficial Жыл бұрын
no need@@abudardamallik1651
@Rytham.
@Rytham. 3 ай бұрын
Send this code on my email
@MrudulaSonawane
@MrudulaSonawane 2 ай бұрын
your way of teaching is so detailed yet in short time......excellently taught this concept ...just awesome.... .thankyouuuuu..........
@rsingh6216
@rsingh6216 3 жыл бұрын
Today stacks has been started in my class ,i hope you will upload videos before the mid sem. Love❤️❤️❤️
@dheepanbalajil1034
@dheepanbalajil1034 3 жыл бұрын
Neso academy is the best channel to learn dsa in youtube
@atmos_360
@atmos_360 Жыл бұрын
Took me forever to learn from my textbook. But your explanation was something unimaginably easy and clear. Thank you Sir!
@vettri5002
@vettri5002 Жыл бұрын
Very Clear Explanation excellent👌🏾👌🏾
@DeepakKumar-nk3cv
@DeepakKumar-nk3cv 3 жыл бұрын
Sir this is huge request plzz complete this course ASAP.......🙏🙏🙏
@dipeshsamrawat7957
@dipeshsamrawat7957 3 жыл бұрын
I love Neso Academy :)
@mohdtarik4803
@mohdtarik4803 2 жыл бұрын
Thanks sir from Kanpur 💕💯👌 good explanation of this session in KZbin
@AllInONE003-w8t
@AllInONE003-w8t 3 жыл бұрын
you are the best lecturer i have seen thank u so much
@anveshatagore542
@anveshatagore542 3 жыл бұрын
Jai ho maharaj 🙏🙏🙏. Just continue the same..upload as many videos of DS and complete this course.. Thanks a ton. Cz of you i learned c language and DS 🙏
@mahesh_rathod27
@mahesh_rathod27 2 жыл бұрын
Best video ❤️💯
@ramakrishnareddy7691
@ramakrishnareddy7691 3 жыл бұрын
Sir make sure to continue the videos please continue sir🙏🙏🙏🙏🙏🙏
@whatsotangy
@whatsotangy 11 ай бұрын
This is best video ♥️ thank you sir
@subhashinisatuluri9167
@subhashinisatuluri9167 2 жыл бұрын
Excellent explanation 👌 👏 sir
@manjunadhkonapalli4260
@manjunadhkonapalli4260 3 жыл бұрын
Sir please Complete the Discrete Mathematics playlist as early as you can (Humble request). It is very much usefull to us in terms of concepts and understanding too... So I have also referred this playlist to many of my frnds. Only bcz it's incomplete, they are feeling somewhat inconvenience. (Going to another channel). So please complete it soon sir🙏
@allaboutjee6530
@allaboutjee6530 Жыл бұрын
What is the use of discrete mathematics for cs student
@_PRANAYMATE
@_PRANAYMATE 2 жыл бұрын
Thanks for the best explanation
@hinayadav6460
@hinayadav6460 3 жыл бұрын
Thanks for this video... 😇😇 Explanation was greart
@ujwalapatil650
@ujwalapatil650 3 жыл бұрын
Thanks for your hard work.
@ankitmishra697
@ankitmishra697 9 ай бұрын
thankyou sir ,best explanation
@Shabareesha
@Shabareesha 2 ай бұрын
Thank you so much sir
@Kat.kritian
@Kat.kritian Жыл бұрын
Thank you sir😘
@gandhamprakash
@gandhamprakash 2 жыл бұрын
excellent sir
@pallavimahadevappa819
@pallavimahadevappa819 Жыл бұрын
Thanks for the video
@ketanpandey182
@ketanpandey182 Жыл бұрын
what is the use of the two while loops used in polyadd function after the first while loop ?????
@giabaonguyen5641
@giabaonguyen5641 Жыл бұрын
very useful, i love you
@benamarcoding1591
@benamarcoding1591 2 жыл бұрын
Thanks for the video , I'm looking for recursive way to do this ?
@mohamedrazith1323
@mohamedrazith1323 3 жыл бұрын
#include #include void print(struct node *head3); struct node { float coeff; int expo; struct node *next; }; struct node *insert(struct node *head,float co,int ex) { struct node *temp; struct node *newp=(struct node *)malloc(sizeof(struct node)); newp->coeff=co; newp->expo=ex; newp->next=NULL; if(head==NULL || ex>head->expo) { newp->next=head; head=newp; } else { temp=head; while(temp->next!=NULL && temp->next->expo>=ex) { temp=temp->next; } newp->next=temp->next; temp->next=newp; } return head; } struct node *create(struct node *head) { int n,i,ex; float co; printf("please enter the number of nodes :\t--==> "); scanf("%d",&n); for(i=0;iexpo==ptr2->expo) { head3=insert(head3,ptr1->coeff+ptr2->coeff,ptr1->expo); ptr1=ptr1->next; ptr2=ptr2->next; } else if(ptr1->expo>ptr2->expo) { head3=insert(head3,ptr1->coeff,ptr1->expo); ptr1=ptr1->next; } else if(ptr2->expo>ptr1->expo) { head3=insert(head3,ptr2->coeff,ptr2->expo); ptr2=ptr2->next; } } while(ptr1!=NULL) { head3=insert(head3,ptr1->coeff,ptr1->expo); ptr1=ptr1->next; } while(ptr2!=NULL) { head3=insert(head3,ptr2->coeff,ptr2->expo); ptr2=ptr2->next; } printf(" ADDED POLYNOMIALS IS "); print(head3); } void print(struct node *head3) { struct node * temp=head3; if(head3=NULL) printf("no polynomials"); while(temp!=NULL) { printf("(%.1f)^%d",temp->coeff,temp->expo); temp=temp->next; if(temp!=NULL) { printf("+"); } else printf(" "); } } int main() { struct node *head1 = NULL; struct node *head2 = NULL; ; printf("POLYNOMIAL 1 "); head1=create(head1); printf(" POLYNOMIAL 2 "); head2=create(head2); polyadd(head1,head2); return 0; }
@prajapatishyamdineshkumar4456
@prajapatishyamdineshkumar4456 3 жыл бұрын
thanks bro
@subashkannan949
@subashkannan949 3 жыл бұрын
thanks bruh....but in 3rrd line no need to declare like that...instead u can give void print().
@subashkannan949
@subashkannan949 3 жыл бұрын
code is working fine but the output is not crt can u check it and resend the code
@prajapatishyamdineshkumar4456
@prajapatishyamdineshkumar4456 3 жыл бұрын
@@subashkannan949 yes same issue
@hareeshkumar9554
@hareeshkumar9554 3 жыл бұрын
@@prajapatishyamdineshkumar4456 output haven,t give the sum in this..
@Nirala_414
@Nirala_414 3 жыл бұрын
Thankyou sir💚💚
@aayushjha8604
@aayushjha8604 3 жыл бұрын
Thanks for the video sir...
@syedabuthahira8053
@syedabuthahira8053 3 жыл бұрын
Sir I want any of your instructors to teach design and analysis of algorithms this chapter was very important in the aspects of gate as well as in our curriculum currently we have this it is very helpful for us if u teach that subject
@learninginstudentscafe7284
@learninginstudentscafe7284 3 жыл бұрын
Good work
@sanchisingh5117
@sanchisingh5117 2 жыл бұрын
please upload videos on trees. I am searching everywhere but none of the video quality match yours and i understand your explanation well
@nikgshort3974
@nikgshort3974 2 жыл бұрын
me too
@rajeshprajapati6662
@rajeshprajapati6662 2 жыл бұрын
Uploaded on website.
@nikgshort3974
@nikgshort3974 2 жыл бұрын
@@rajeshprajapati6662 on which web
@mriduldubey2920
@mriduldubey2920 2 жыл бұрын
THANK YOU SIR
@RutvikKumbhar90
@RutvikKumbhar90 Жыл бұрын
How to insert the direct equation as a user input Like i type x^2+5x+2 and the program should be understood the variables and operations (characters) ?
@dayanandjajodia8698
@dayanandjajodia8698 2 жыл бұрын
it could be better if I could get the code and copy it.
@nikgshort3974
@nikgshort3974 2 жыл бұрын
sir its humble request to make videos on tree and graphs pls pls sir
@ShriAakarshanafashions
@ShriAakarshanafashions 3 жыл бұрын
can anyone pls send the link for previous lecture for insert and print function as you said in this video
@SaiKumar-cs6sf
@SaiKumar-cs6sf Жыл бұрын
Why we use insert in addition of two polynomials
@chithra7556
@chithra7556 10 ай бұрын
Where can i get this code
@mney7486
@mney7486 3 жыл бұрын
sir resultant liked list not in sorted form please explain
@ashishjha7695
@ashishjha7695 3 жыл бұрын
Great explanation sir
@adolfocarrillo248
@adolfocarrillo248 9 ай бұрын
Merge sort adapted for Linked lists.
@TheRoosevel
@TheRoosevel 2 жыл бұрын
can u pls provide the same in java, sir?
@nageegundala1142
@nageegundala1142 3 жыл бұрын
Plz give code link To execute my self
@adityatrivedi931
@adityatrivedi931 3 жыл бұрын
Bro could you provide the source code ?
@simbagaming4847
@simbagaming4847 2 жыл бұрын
Source code plz sir
@gandhamprakash
@gandhamprakash 2 жыл бұрын
sir could you please comment the code in comment section
@srinithi9510
@srinithi9510 2 жыл бұрын
exponet means what
@siddhantyadav4531
@siddhantyadav4531 3 жыл бұрын
Sir Your Video is coming very late Sir please upload ASAP
@Kishan_Gupta2.0
@Kishan_Gupta2.0 Жыл бұрын
Bhai code bhi de diya kar
@bharathkumarhydari5941
@bharathkumarhydari5941 Ай бұрын
Exam in hours😅
@gautham7244
@gautham7244 3 жыл бұрын
#include #include struct polynode { float coeff; int expo; struct polynode *link; }; struct polynode *insert(struct polynode* head,float co,int ex) { struct polynode *temp; struct polynode* newp=malloc(sizeof(struct polynode)); newp->coeff=co; newp->expo=ex; newp->link=NULL; //If there is no node in the list or given exponent is greater than first node exponent if((head==NULL)|| ex>head->expo) { newp->link=head; head=newp; } else { temp=head; while(temp->link != NULL && temp->link->expo>=ex) { temp=temp->link; } newp->link=temp->link; temp->link=newp; } return(head); } struct polynode* create(struct polynode *head) { int n,i; float coeff; int expo; printf("Enter the number of terms "); scanf("%d",&n); for(i=0;icoeff,temp->expo); temp=temp->link; if(temp!=NULL) { printf(" + "); } else { printf(" "); } } } } void polyAdd(struct polynode* head1,struct polynode* head2) { struct polynode* ptr1=head1; struct polynode* ptr2=head2; struct polynode* head3=NULL; while(ptr1!=NULL && ptr2!=NULL) { if(ptr1->expo == ptr2->expo) { head3=insert(head3,ptr1->coeff+ptr2->coeff,ptr1->expo); ptr1=ptr1->link; ptr2=ptr2->link; } else if(ptr1->expo>ptr2->expo) { head3=insert(head3,ptr1->coeff,ptr1->expo); ptr1=ptr1->link; } else if(ptr1->expoexpo) { head3=insert(head3,ptr2->coeff,ptr2->expo); ptr2=ptr2->link; } } while(ptr1!=NULL) { head3=insert(head3,ptr1->coeff,ptr1->expo); ptr1=ptr1->link; } while(ptr2!=NULL) { head3=insert(head3,ptr2->coeff,ptr2->expo); ptr2=ptr2->link; } printf("Added polynomial is:"); print(head3); } int main() { struct polynode* head1=NULL; struct polynode* head2=NULL; printf("Enter the first polynomial: "); head1=create(head1); printf("Enter the second polynomial: "); head2=create(head2); polyAdd(head1,head2); return 0; }
@gautham7244
@gautham7244 3 жыл бұрын
I am getting wrong output when I run this code
@gautham7244
@gautham7244 3 жыл бұрын
Can anyone help me with this please
@devakinandan23
@devakinandan23 2 жыл бұрын
Thanks a lot
@warrior_monk_fit
@warrior_monk_fit 2 жыл бұрын
SOURCE CODE #include #include struct node { float coeff; int expo; struct node *next; }; struct node* insert(struct node* head,float co,int ex) { struct node *temp; struct node* newP = malloc(sizeof(struct node)); newP->coeff = co; newP->expo = ex; newP->next = NULL; if(head==NULL || ex > head->expo) { newP->next = head; head = newP; } else { temp=head; while(temp->next != NULL && temp->next->expo >= ex) temp=temp->next; newP->next = temp->next; temp->next = newP; } return head; } struct node* create(struct node* head) { int n,i; float coeff; int expo; printf("please enter the number of nodes :\t--==> "); scanf("%d",&n); for(i=0; icoeff, temp->expo); temp = temp->next; if(temp!=NULL) printf(" + "); else printf(" "); } } } void polyadd(struct node* head1,struct node* head2) { struct node* ptr1 = head1; struct node* ptr2 = head2; struct node* head3 = NULL; while(ptr1 != NULL && ptr2 != NULL) { if(ptr1->expo == ptr2->expo) { head3 = insert(head3, ptr1->coeff+ptr2->coeff, ptr1->expo); ptr1 = ptr1->next; ptr2 = ptr2->next; } else if(ptr1->expo > ptr2->expo) { head3 = insert(head3, ptr1->coeff, ptr1->expo); ptr1 = ptr1->next; } else if(ptr1->expo < ptr1->expo) { head3=insert(head3,ptr2->coeff,ptr2->expo); ptr2=ptr2->next; } } while(ptr1!=NULL) { head3 = insert(head3, ptr1->coeff, ptr1->expo); ptr1 = ptr1->next; } while(ptr2!=NULL) { head3 = insert(head3, ptr2->coeff, ptr2->expo); ptr2 = ptr2->next; } printf(" ADDED POLYNOMIALS IS "); print(head3); } int main() { struct node* head1 = NULL; struct node* head2 = NULL; printf("POLYNOMIAL 1 "); head1 = create(head1); printf(" POLYNOMIAL 2 "); head2 = create(head2); polyadd(head1, head2); return 0; }
@vamsikrishna8082
@vamsikrishna8082 2 жыл бұрын
Hi
@justagenzontheinternet808
@justagenzontheinternet808 2 жыл бұрын
Can you give us the java one pls?
@ironman-ht4ov
@ironman-ht4ov 3 жыл бұрын
dude can anyone just give me this code...it's a request @Neso please share the code in the description
@debrajdey9060
@debrajdey9060 3 жыл бұрын
#include #include struct node { float coeff; int expo; struct node *next; }; struct node *insert(struct node *head, float co, int ex) { struct node *temp; //Creating a new node struct node *newp = malloc(sizeof(struct node)); newp->coeff = co; newp->expo = ex; newp->next = NULL; if (head == NULL || ex > head->expo) { newp->next = head; head = newp; } else { temp = head; while (temp->next != NULL && temp->next->expo > ex) { temp = temp->next; } newp->next = temp->next; temp->next = newp; } return head; } struct node *create(struct node *head) { int n, i, expo; float coeff; printf("Enter the no of terms"); scanf("%d", &n); for (i = 0; i < n; i++) { printf("Enter the coeff of the term %d:", i + 1); scanf("%f", &coeff); printf("Enter the expo of the term %d:", i + 1); scanf("%d", &expo); head = insert(head, coeff, expo); } return head; } void print(struct node *head) { if (head == NULL) { printf("No polynomial"); } else { struct node *temp = head; //Assigning head to temp pointer while (temp != NULL) { printf("(%.2fx^%d)", temp->coeff, temp->expo); temp = temp->next; if (temp != NULL) { printf(" + "); } else { printf(" "); } } } } struct node *poly_add(struct node *head1, struct node *head2) { struct node *ptr1 = head1; struct node *ptr2 = head2; struct node *head3 = NULL; while (ptr1 != NULL && ptr2 != NULL) { if (ptr1->expo == ptr2->expo) { head3 = insert(head3, ptr1->coeff + ptr2->coeff, ptr1->expo); ptr1 = ptr1->next; ptr2 = ptr2->next; } else if (ptr1->expo > ptr2->expo) { head3 = insert(head3, ptr1->coeff, ptr1->expo); ptr1 = ptr1->next; } else if (ptr1->expo < ptr2->expo) { head3 = insert(head3, ptr2->coeff, ptr2->expo); ptr2 = ptr2->next; } } while (ptr1 != NULL) { head3 = insert(head3, ptr1->coeff, ptr1->expo); ptr1 = ptr1->next; } while (ptr2 != NULL) { head3 = insert(head3, ptr2->coeff, ptr2->expo); ptr2 = ptr2->next; } printf("The added polynomial is : "); print(head3); } int main() { struct node *head1 = NULL; struct node *head2 = NULL; printf("Enter the first polynomial : "); head1 = create(head1); printf(" "); printf("Enter the second polynomial : "); head2 = create(head2); printf(" "); poly_add(head1, head2); return 0; }
@funnyanimation888
@funnyanimation888 3 жыл бұрын
@@debrajdey9060 Thanks
@evolve1431
@evolve1431 3 жыл бұрын
Sir Your Video is coming very late Sir please upload ASAP
Application of Linked List (Multiplication of Two Polynomials)
14:00
2.8 Reverse a Linked List - Iterative Method | Data Structure Tutorials
18:44
Jenny's Lectures CS IT
Рет қаралды 453 М.
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 134 М.
Learning C# In A Week... Otherwise I Fail University
9:04
Application of Linked List (Polynomial Arithmetic) - Part 2
22:54
Neso Academy
Рет қаралды 107 М.
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 964 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
3.6 Infix to Postfix using Stack | Data Structures Tutorials
20:10
Jenny's Lectures CS IT
Рет қаралды 1,9 МЛН
Hash Tables and Hash Functions
13:56
Computer Science Lessons
Рет қаралды 1,6 МЛН
4.2 Implementation of Queue using Arrays | Data Structures & Algorithm Tutorials
23:06
2.4 Linked List Implementation in C/C++ | Creation and Display | DSA Tutorials
29:01
Jenny's Lectures CS IT
Рет қаралды 1,9 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН