Linked List in C++ - Part 1 | Lecture 50 | C++ and DSA Foundation Course
Vložit
- čas přidán 7. 08. 2024
- Have you heard of the data structure called a linked list? It's the most dynamic and versatile data structure as far as implementation is concerned.
In this class, Urvi mam will cover linked list concepts from the very basics to the advanced implementations.
Follow us to prepare for the college exams, interviews and placements with immaculate problem-solving and coding skills.
See you in the class !!
Are you finding the classes helpful?
Stay tuned for more!
Access the notes and assignments for this class for free at : pwskills.com/course/C++--Foun...
PW Skills is announcing the launch of the following programs,
Decode Batch:- DSA with C++
pwskills.com/course/Decode-DS... (Hinglish)
Binary Batch:- Java-with-DSA-&-System-Design (Java with DSA & System Design)
pwskills.com/course/Java-with... (Hindi)
pwskills.com/course/Java-with... (English)
Sigma Batch:- Full-Stack-Web-Development (MERN Stack)
pwskills.com/course/Full-Stac... (Hindi)
pwskills.com/course/Full-Stac... (English)
Impact Batch:- Data-Science-Masters (Full Stack Data Science)
pwskills.com/course/Data-Scie... (Hindi)
pwskills.com/course/Data-Scie... (English)
Website - pwskills.com/
Instagram - / pwcollegewallah
LinkedIn - / ineuron-ai
/ physicswallah
Telegram - t.me/SkillsPW
Discord - / discord
Twitter - / pw__skills
PW Skills Instagram : / pw.skills
00:00 - Introduction
00:42 - Recap
01:07 - Today's checklist
01:27 - What is linked list
03:52 - Challenges of an array
09:00 - Advantages of linked list over an array
12:39 - Listnode
17:18 - Types of linked list
20:06 - Implementation of a listnode in singly linked list
24:14 - Traversal in a singly linked list
28:24 - Insertion at kth position in a singly linked list
50:57 - Updation at kth position in a singly linked list
54:09 - Deletion at kth position in a singly linked list
01:09:55 - Given the head of a linked list, delete every alternate element from the list starting from second element
01:29:32 - Given head of a sorted linked list, delete all duplicates such that each element appears only once. Return the sorted linked list too.
01:44:15 - Traversing in the reverse order
01:55:27 - Given the head of a singly linked list, reverse the list and return the reversed list (Common and recursive both)
02:21:19 - Given the head of a list, reverse the nodes of the list k at a time and return the modified list.
#LinkedList #C++ #DSA #CollegeWallah #OneShot #PhysicsWallah
was struggling with LL for more than a week..but came across this best lecture on LL❤❤..now pretty confident for exams....thank you maam❤❤
nice work on explaining the whole thing, your's is the first video where i did not get confused after watching it
For supporting team i would highly recommend to please add the all videos of the c++ DSA foundation course in playlist❤
😢
@@manishdet0189 what happens bhaiya.
its already there
1:55:27 Leetcode(206) - Reversing a linked list
Ma'am your way of teaching is just brilliant.
Thankyou you mam for teaching dsa in easily ❤
your way of teaching is just brilliant. Harder the topic easier you make for us. Thanks a lot for this quality content.
iske notes h aapke pass agr h to pls share kr dijiye
Thanks a lot mem👍...your explanation is very helpful to me....
I got this finally!! Linked List is HARD to learn but its interesting to do operations on it .... many many Thanks to Urvi mam !!😇❣
here I am again on this video, after forgetting everything what i learnt 1 year before in April 2023.... Guys plz don't take any break during DSA journey, you will forget everything, and phir se track pr aane ke liye bhi bahot himmat aur mehnat lagti hai!🙏🙏🙏!(17 May 2024)
smooth....very grateful to u mam😍😍😍
very Impressive ! I really enjoyed learning from your videos.
best video for linked list in youtube❤❤❤❤
1:10:50
Thanks to you i was able to do it in less than 15 min
void solve(Node* &head) {
Node* temp = head;
while(temp != NULL) {
Node* dele = temp;
dele = dele->next;
temp->next = dele->next;
free(dele);
temp = temp->next;
}
}
last question is a leetcode hard version Actually maam taught it soo easily
One of the best lectures on the linked list I have ever come across.
GUYS A SMALL UPDATE IN LAST QUES.
IF K=4, ANSWER MUST BE: 4->3->2->1->5->6 *, as we have rotate K nodes only.
So what y'all can do is:
Node* check = head;
int len = 0;
while(check!=NULL){
check = check->next;
len++;
if(len==k) break;
}
if(len
I highly appreciate you.
The way of teaching is very effective.
Well explained. I was struggling to understand LL . but after watching this session it clear my all doubts.
What is the base case for reversing k nodes In last recursive code?
2:43:50
thanks a lot
Thank you mam ❤❤
Please mam don't compromise the quality of content we are following from the 1st now you sumup all these contents in one series please sir try to cover all the topics we are following from the starting.
mam genuinly u r so gud ...its my first tym comin to ur channel nd for sure not the last..
Hello, thanks for the wonderful explanation. Can you plz provide with the notes and code of the playlist for the learning purpose. Thanks
mam apne dynamic memory allocation padhaye bina pura linked list padha diya
bina dynamic memory allocation k kisi ko kuch samajh nhi ayga ki kya chl rha hai
Hii bhai vo kaha se sikhe ?? Muje ye pointers kaise use kiye is tarike se ye nahi samaj aaya itna pointers pata hai par itna deep me nahi samaj aaya
bhai me recommend krunga ki tum double pointers aur pass by reference ache se sikh lo
aur dynamic memory allocation aur oops codeHelp se sikh lena@@neverstoplearning3451
Newhead will be passing means new head will be returning that's why we are using node *????
My fav DS is BST!!
The link for notes is not working
Feeling Blessed Thank You MAM🤩
great
Where shall I find pdf of this lecture?
need some correction in the last problem for ex [1,2,3,4,5] and k=3 output should be [3,2,1,4,5] but it is returning [3,2,1,5,4]
Yess mam we want a next some videos of binary tree, heap, graph, greedy algo and some other important topics of DSA plss mam I would highly recommend pls add some next videos. Thank you so much for deep explaination❤️💯
where do you get the notes of these?
@@rishitdas5228 pw.skills website
Please make the notes accessible
We can't access them it shows some errors...
Can u provide me notes?
31:35 head ka pointer change karne kai liye head = new_node; kiya hai
can you run translation
was searching for a good explanation found this, i took 3 days to properly watch and make codes on my own. Gotta say this really helped thank you so much.
Didi Thanks 🥰
Mam i can't find notes of this lecture
maam apki tree data structure ka playlist hai?
it will gives me an errror while i accessing Notes
hello ma'am , can you provide us this code
Ma'am there is one thing for sure that because of this One shot thing the practice question have not been provided on the site and also The playlist for C++ course has not been updated yet. I have been trying to reach out for this for days now and haven't received some solution. And the assignments which are on the site are even not granting us access so please get it checked and do upload assignments so that we could practice regularly.
Guys.. pls tell me how can I get the notes of this lecture and all previous lectures
lots of respect from Pakistan maam
pls share the code mam
From ucp lahore❤
Plz provide 1 hr lecture topic wise , don't do that sum up in one lecture
Till 47 lectures content is top class but now quality has been compromised 😕😕
Please make a video on TCS NQT 2023 test.
How to prepare?
What to read?
Where to practice?
How much coding is required?
What is the smart way to practice test within short time?
Can anyone send me this video's codes please ??
what is the use of arrow in coding???
It is used as a pointer
2:45:16 ❤❤❤
Good 👍
best video
1:28:38 - exactly same code for deleteAlternateNodes is showing segmentation fault in vs code (in pw labs) , i have checked the code but it is same , it is now showing segmentation fault on removing curr_node != Null from while condition ...
Anyone ..? who can help...?
void deletealternative(Node* &head){
Node* temp=head;
while(temp->next!=NULL){ //1->2->3->4->null
Node *garbage=temp->next;
temp->next=temp->next->next;
free(garbage);
temp=temp->next;
}
} Try this in your compiler, its working fine if even no. of elements are in list.
one word for you -"thank you"
Arigato Guzaimasu will be more suitable 😊
Awesome
mam please upload the notes of the lecture
Mam please upload video regularly
41:58
2:20:53
bhai line by line explain to kardo likhte time code .. line 18 mei kyu kia hai aisa ye sab kaun btaega?? ye to wohi smajh skta hai jisne 2-4 baar pehle se padha ho ye topic.
maam bas apna padha rhi hain , isme itne sare cheezen hain jo pehle ke lectures me shi se explain bhi nhi kra
Aaj pw ka app and PW skills ki site nhi chl rhi
Long Time awaited🥱🙏
But in the function insertAtHead it gives an error can't convert node*to int in assignment new_node = head
New_node->next =head
mujhe pata hai kyo aaya
While inserting a node at last in an empty node at 40:43 the code is not working in vs code
40:00 if you have not insert any element into head and your head is NULL and you are trying to do same as she did you will get error so instead of doing that add this on insertAtTail() if(head == NULL) head = new_node; and put everything along temp inside else ,,, reason :: she inserted element while teaching insertAtHead so her head was not NULL...
Mam mujhe plz reply karo
Mai decode batch login nhi ho raha h
Maine subscribe ker liya h please
Batch update ho raha h kya🙏
Sir main kal se pw skill mein log in nhi kar pa Raha hoon.
Mere video backlog increase ho raha hai please resolve my problem.
1:27:51 But why not current->next = temp->next??? 🚨⚠️
mam please video regular upload ki geya
Please continue java dsa series it's been more than a month but no video uploaded yet
I know I am late, and I am sorry, but a very Happy Belated Teachers day Team :)
JO AATA THA VO BHI BHUL GAYA 👍
Bhaag yaha sai
ma'am made a movie on linked list😆😆
I am third ...😊
40:00 if you have not insert any element into head and your head is NULL and you are trying to do same as she did you will get error so instead of doing that add this on insertAtTail() if(head == NULL) head = new_node; and put everything along temp inside else ,,, reason :: she inserted element while teaching insertAtHead so her head was not NULL...
notes?
Java mai jese 5 hours ki interview questions upload kiye ho bas c++ mai vi usi questions ko chod ke baki Jo leet Code mai linkedlist ki questions hai us upar eka video bana dije mama
Aur kitne topic bache hai🤯
tree , graph , stacks , queue etc
Bhay DSA hai.
Data structures
1. Array
2. Linked List
3. Stack
4. Queue
5. Binary Tree
6. Special Trees
7. Graph
8. Heap
9. Tries
10. Miscellaneous
Algorithm
1. Divide and Conquer
2. Greedy Method
3. Branch and Bound
4. Backtracking
5. String Algorithm and KMP matching
6. Graph Algorithms
7. Miscellaneous.
Har kisi ka 3-4 ghante ka video banna chahiye approx.
@@godson200 bhot time lgega bhai kyuki video bhut slow upload ho rhi hai
@@ramanshrivastava1407 6 mahine kaha tha naa.
DSA yaar ek baar karna chahiye lekin shaanti se.
Ek accha course banane m 1-1.5 year lag jayega lekin wo for the ages rehna chahiye.
Ye patience naa students mein hai na teachers mein hai.
Toh ab yehi mediocre content se kaam chalana pahdega
@@godson200 🙏🙏offline soch rha hu ab
mam inseartAtTail () function
give me error
kyo
2nd question me segmentation fault ahha raha hai.... Why
mujhe pata hai
source code milega kahi?
kiska hona bata mai deta hu
4th viewer🎉🎉
I am 2nd
Int a; a ka data type Int hai. similarly
Node *next; next pointer ka data type Node hai. 👍
it should not be written like Node* next . ❌
what about node* &head?
and what about Node* reverseLinkedList() ???
writing node* &head and node *&head in the parameters are equivalent.
@@sumitsahni5402 and bro what about writing node* as a return type for a function
Good, but pure lecture mein for loop se input Lena toh sikhaya hi nahin gaya
BHAIYA ME AAPKI SAARI VIDEOS SE STUDY KRTI HU...AND MOBILE ME PRACTICE KRTI HU...
I CAN'T AFFORD LAPTOP
I REQUEST PW TEAM TO OFFER LAPTOPS TO NEEDY STUDENTS 😞
I am first viewer 😃
1hr30min
please itne bade bade lecturee mt do dekhne mai aatma bahar aa jati haii 🙏🙏🙏🙏🙏🙏
With all due respect whatever you are teaching is not best practice for coding in DSA.
How can u explain????
I want to marry urvi maam
Kya Umar h beta aapki.
@@godson200 tumse jyada
simp alert
Pin this comment
@@TarunPurohit02 bhaag badk
2025 me iss lecture ko dekhne vale kitne hai😊...
(reverse k-list full iterative)
void reverse_k_list(Node* &head,int pos)
{
Node* temp = head;
Node* prev_temp=NULL;
Node* temp1=head;
int p=1;
while(p!=pos)
{
temp1=temp1->next;
p++;
}
Node* newhead=temp1;
while(temp!=NULL)
{
int k=1;
Node* next =temp->next;
Node* prev =NULL;
Node* dummy=temp;
while(k!=pos && temp!=NULL && temp->next!=NULL)
{
temp->next = prev;
prev=temp;
temp=next;
next=next->next;
// temp->next = prev;
k++;
}
temp->next=prev;
if(prev_temp==NULL)
{
prev_temp=dummy;
}
else{
prev_temp->next = temp;
prev_temp=dummy;
}
// dummy=temp;
prev=temp;
temp=next;
}
head=newhead;
return;
}
Handwriting is poor
BHAIYA ME AAPKI SAARI VIDEOS SE STUDY KRTI HU...AND MOBILE ME PRACTICE KRTI HU...
I CAN'T AFFORD LAPTOP
I REQUEST PW TEAM TO OFFER LAPTOPS TO NEEDY STUDENTS 😞