[User] Please transcribe this text

[Assistant] Connections. Writing and art.


[User] Please transcribe this text

[Assistant] How many places in the book are inside?


[User] Please transcribe this text

[Assistant] How many places in the book are outside?


[User] Please transcribe this text

[Assistant] With your class, make a graph to show how many there are of each.


[User] Please transcribe this text

[Assistant] Six people were hanging out on exile together, and then we all had to compete, get our way back into the game, like, so awesome.


[User] Please transcribe this text

[Assistant] I was keen to come out here. Look, I put my hand up! Another still in exile.


[User] Please transcribe this text

[Assistant] Ooh, I'm ready to get down, I'm ready to lay some beatdowns and get my butt back in the game. Who else can say they've been to Exile twice in survival?


[User] Please transcribe this text

[Assistant] I just gutted. Absolutely gutted. It was my challenge to lose, and I messed up.


[User] Please transcribe this text

[Assistant] This isn't how I had exile planned out at all. I was planning on winning today and going back to my tribates, I'd even packed a coconut. Ready for the home trip.


[User] Please transcribe this text

[Assistant] But this is Survivor, it looks much better on the resume if I win my way out of exile.


[User] Please transcribe this text

[Assistant] Make no mistake, I'm dead serious. I need to win that next challenge. I'm gonna give it everything I got.


[User] Please transcribe this text

[Assistant] Yeah, 100%. I mean, we're all in the same boat right now. This is a must-win for every single one of us. But, you know, I'm here. I'm ready. Ready to bring my hair game. Let's go.


[User] Please transcribe this text

[Assistant] I waged my life for my tribe, so hopefully they're, uh, gonna return the favour.


[User] Please transcribe this text

[Assistant] I know my neck is on the chopping block, but I've got five other people that are rock solid. They're airtight. They're not gonna flip on me at all. My boy Dave!


[User] Please transcribe this text

[Assistant] He's got an idol and he said, if he smells anything fishy, he's gonna play that bad boy for me. And I honestly believe that. So, I'm feeling pretty confident.


[User] Please transcribe this text

[Assistant] Actually, I don't feel too bad right now. Luckily, uhm, we're sitting in a boat where I've got a fairly strong alliance that I have a lot of trust in.


[User] Please transcribe this text

[Assistant] Absolutely knew that my Alliance were going to stick by me and take care of me, so yeaah. I mean it sucks to be these two. We've had a lot of good chats too, so it is sad to see one of them go.


[User] Please transcribe this text

[Assistant] Ah, well played guys. Well played.


[User] Please transcribe this text

[Assistant] It definitely bit me in the butt to put my hand up to go to exile. Kinda wish I hadn't have done that now. I should have known my line still wasn't gonna have my back.


[User] Please transcribe this text

[Assistant] This time around I just worked a lot more on my social side of the game, but obviously still not quite enough. I suppose I should choose the people I want to work with a little bit better.


[User] Please transcribe this text

[Assistant] Shiny and I, we actually really bonded over at Exile. She decided to turn on me. That's the game survivor really, she got me again.


[User] Please transcribe this text

[Assistant] Big Dog, Alpha Wolf, signing off. Peace!


[User] Please transcribe this text

[Assistant] Help me, help me, I'm the guy who's drowning. I need you to pull me up and send me a life raft.


[User] Please transcribe this text

[Assistant] I think it was only a matter of time that, you know, we had to have a loss. And we've had two in a row.


[User] Please transcribe this text

[Assistant] When you lose a challenge, especially if it's immunity, it's a nightmare.


[User] Please transcribe this text

[Assistant] But I'm not that disappointed because tonight's vote is very simple.


[User] Please transcribe this text

[Assistant] And the only big issue that we all have is how to spell it correctly.


[User] Please transcribe this text

[Assistant] AK going for the second one and he lands it! Valkyma, Lee, two zip!


[User] Please transcribe this text

[Assistant] You know, my name's probably been thrown out there.


[User] Please transcribe this text

[Assistant] I didn't exactly produce the best performance of my life.


[User] Please transcribe this text

[Assistant] Zach is a big part of my plan to get to the end. I have two idols in my pocket. If I think I need to use it, I will.


[User] Please transcribe this text

[Assistant] Last night was worst case scenario for me.


[User] Please transcribe this text

[Assistant] The plan was to stay tight as a strong six.


[User] Please transcribe this text

[Assistant] And just vote out the Vakama 3 one by one. And Jackie flipped on us.


[User] Please transcribe this text

[Assistant] Jackie has just blown up a majority alliance, destroying her game as well as mine.


[User] Please transcribe this text

[Assistant] Now that my meat shield, Zack, is gone, I am in a very precarious place.


[User] Please transcribe this text

[Assistant] But this is survivor. You need to be able to evolve and adapt.


[User] Please transcribe this text

[Assistant] Zack was a big part of my game, but I still have Tarzan.


[User] Please transcribe this text

[Assistant] He really has become like a big brother to me out here. I think he really feels a good connect with me.


[User] Please transcribe this text

[Assistant] Right now I'm in a very dangerous position. Woohoo! And I have to tread very, very carefully.


[User] Please transcribe this text

[Assistant] I gotta make sure my eyes and ears Tarzan does not consider flipping on me.


[User] Please transcribe this text

[Assistant] What would you buy? We'd keep a nice one for Mo and Sean too, I reckon.


[User] Please transcribe this text

[Assistant] I'm really thankful to Tarzan right now. Uhm, I have put a lot of work into that relationship.


[User] Please transcribe this text

[Assistant] And in a way I've always known that Tarzan will have my back.


[User] Please transcribe this text

[Assistant] Yeah, it was a really good one. A big move happened and I thought it was pretty exciting but definitely a shocker for some of us.


[User] Please transcribe this text

[Assistant] Uhm, I'm gonna take Sean and Mike.


[User] Please transcribe this text

[Assistant] I know I have two people that have my back at this stage. Mo and Tarzan.


[User] Please transcribe this text

[Assistant] I'm trying to drop in a third person to have my back, and that's Sha. So I decide to use this reward as a way to strengthen my alight.


[User] Please transcribe this text

[Assistant] The thing is, we know what's happening back at camp. Brooke, Shonnie and AK have already flipped Jackie.


[User] Please transcribe this text

[Assistant] Now, where does Shan fit into that piece of the puzzle? Well, Shan has been talking a little bit about blindsiding me. And I chose to keep Shan close to me on this one because I couldn't trust her to be back in camp with Shani and her crew.


[User] Please transcribe this text

[Assistant] This is it. This is where Endgame begins. With Jacky. Are we pretty much across what we're gonna do when we get back?


[User] Please transcribe this text

[Assistant] What is the best way to solidify an alliance than with an epic blindside on Jax?


[User] Please transcribe this text

[Assistant] Everyone is talking about blindsiding me. Everyone except Tarzan and Moe has my blindside in their peripheral.


[User] Please transcribe this text

[Assistant] If I don't win individual immunity on this next one, I'm gonna be in a really tough spot. I need that individual immunity to pull in Shan closer to my game, to lock down Moe and to lock down Tarzan, and to send Jackie home.


[User] Please transcribe this text

[Assistant] Yeah, I can't lie, it was totally amazing. There was a lot of good food, champagne, bath, shower, a massive like bed, cushions, the whole nine yards. It was basically everything we could have hoped for.


[User] Please transcribe this text

[Assistant] I've got quite the collection going at the moment. I got my original immunity idol. The sister, which I got from Phoebe's Clue. My fake little friend here, let's not forget about him.


[User] Please transcribe this text

[Assistant] And of course, individual immunity.


[User] Please transcribe this text

[Assistant] No one man should have all this power, because it goes straight to your head.


[User] Please transcribe this text

[Assistant] Part of this plan tonight to get Jackie voted out is to bring her back to our side.


[User] Please transcribe this text

[Assistant] So, we need to figure out exactly what they've been feeding her while we've been away from camp.


[User] Please transcribe this text

[Assistant] So, we want Jackie to think it's full steam ahead on Shiny. Because if she votes Shiny tonight, Jackie goes home.


[User] Please transcribe this text

[Assistant] Jackie is still a massive wild card in the game, but I think we did a pretty good job today of making her feel wanted, making her feel like she's back in the Alliance, and safe in this game.


[User] Please transcribe this text

[Assistant] I guess the decision was probably a little bit related to, uh, Zach obviously being voted out.


[User] Please transcribe this text

[Assistant] There was a pretty major linchpin in that vote.


[User] Please transcribe this text

[Assistant] Wasn't my favorite thing that happened in the game so far. But I think we've moved forward on that, right?


[User] Please transcribe this text

[Assistant] I like to think that Jackie has made the smart choice tonight.


[User] Please transcribe this text

[Assistant] Yeah, you know what I think I might, John.


[User] Please transcribe this text

[Assistant] I would like to play this for Tarzan. There you go, big dog.


[User] Please transcribe this text

[Assistant] David, you're part of the 6. You don't want to contribute? I mean, I feel like at this stage of the game, if you're risking a 75% chance of going home, that's crazy to me.


[User] Please transcribe this text

[Assistant] As the game ramps up. I need a chance to believe that I want to work with her. Will David make the ultimate mistake?


[User] Please transcribe this text

[Assistant] This has been the hardest night to write down thus far. I'm really sorry, girl.


[User] Please transcribe this text

[Assistant] So, what would our best play be?


[User] Please transcribe this text

[Assistant] If Jackie votes with Shonnie Brook and I tonight, we're gonna have four votes. And that leaves the other alliance with four votes against one of us. That's a tied vote. I ain't flippin' my vote. None of us. We're gonna rock if she votes with us.


[User] Please transcribe this text

[Assistant] It's a deadlock. And we can't come to a unanimous decision.


[User] Please transcribe this text

[Assistant] Then the two people that receive votes then become immune.


[User] Please transcribe this text

[Assistant] Then the people that remain all draw rocks and one person is gonna draw an unlucky rock and be sent home.


[User] Please transcribe this text

[Assistant] I'm ready to make risky moves. And if we come to a stalemate, I am not changing my boat. I'm ready to go to rocks.


[User] Please transcribe this text

[Assistant] Sean is a sensible player. She likes everything calculated and precise. But Rox is not calculated and precise.


[User] Please transcribe this text

[Assistant] So, I'm hoping if the prospect of Rox is out there, she's gonna get spooked and flip her vote onto Mo.


[User] Please transcribe this text

[Assistant] So what, uhm, I think is gonna happen tonight. Either Jackie votes with you guys.


[User] Please transcribe this text

[Assistant] And one of Brooke, Shania and I go home. Or Jackie votes with us. And it's a 4-4 split.


[User] Please transcribe this text

[Assistant] Brooke, Shonnie and I have been on the bottom since the first vote at Merge. And right now, that majority alliance doesn't realise that we are the deadliest trio in this game.


[User] Please transcribe this text

[Assistant] Shani is the best social player, Brooke is a challenge beast, and I'm the accountant crunching the numbers.


[User] Please transcribe this text

[Assistant] And we're going to ride this wave. Fly inside that majority alliance and get ourselves to the end. I am looking forward to fireworks tonight.


[User] Please transcribe this text

[Assistant] David's a smart guy, he's a smart player. If I was hoping to get Jackie on for the next vote, I probably would have taken her.


[User] Please transcribe this text

[Assistant] And she's got a relationship with Shaunie from EXO and she's got a relationship with Brooke.


[User] Please transcribe this text

[Assistant] We are all thinking about our own games. And Jackie knows that. So she's starting to realize that this is an individual game.


[User] Please transcribe this text

[Assistant] That's the stressful part about tonight. A 4-4 vote still doesn't get the job done. Could tie things up. It does.


[User] Please transcribe this text

[Assistant] I'd rather go home trying to better my position within the game than go home and being part of a minority.


[User] Please transcribe this text

[Assistant] If the four of us make it back to camp by not drawing the wrong rock, then all of a sudden we're sitting in the majority.


[User] Please transcribe this text

[Assistant] So in this video tutorial, we're going to be talking about the implementation part of circular linked list. So this is the part two of the circular linked list topic. And before we start off, if you have missed the previous video tutorial,


[User] Please transcribe this text

[Assistant] Wherein we discussed the algorithm and the concept of circular linked list and we also saw our approach and what happens behind the scenes.


[User] Please transcribe this text

[Assistant] And the individual operations. So I would highly recommend that you watch that video because then you'll get a very clear idea and then understanding this code will be very easy.


[User] Please transcribe this text

[Assistant] Not that you have to compulsorily see it, you'll definitely understand this video also. Even if you have not watched the part 1.


[User] Please transcribe this text

[Assistant] Because I will obviously be explaining you the entire code and you'll also see a set of diagrams and visual representations, which will make things very easy. But if you watch the previous video, then your idea will be very clear.


[User] Please transcribe this text

[Assistant] So directly we'll jump to the explanation part because the algorithm and the theory we've already discussed. So with that being said, let's get started.


[User] Please transcribe this text

[Assistant] Okay, so just like single-linguist and double-linguist, we create a class.


[User] Please transcribe this text

[Assistant] Node, by the way, we're using C++ programming and we're using the object oriented concepts. So we've created a class node. In circular linked list we have


[User] Please transcribe this text

[Assistant] A key data member which uniquely identifies one particular node object. Then we have the data member which actually stores the data.


[User] Please transcribe this text

[Assistant] And we also have a pointer which is of the same class node. So you can see node star and it points to the next node. Okay.


[User] Please transcribe this text

[Assistant] One major difference that is the last node in the circular linked list points back to the first node or the head node. Okay. So that's the only major difference. Otherwise pretty much this code is the same if you've seen singly linked list implementation. So yeah, this was the node class pretty basic to understand, right? Don't worry guys. I'm going to be sharing all the code with you and you can see links in the video description.


[User] Please transcribe this text

[Assistant] To the official website wherein I have uploaded this code with the explanation. So you can go check that out. You can directly copy paste and use it yourself.


[User] Please transcribe this text

[Assistant] So yeah, let's move ahead. The next class that we create is the circular linkless class and the object of this class is actually going to have only one data member, which is going to be the


[User] Please transcribe this text

[Assistant] Head pointer again the same type of node because this pointer is also going to point to an object of node class only. Okay.


[User] Please transcribe this text

[Assistant] And then we have basic constructors. So initially when you create the object of circular linked list, the head pointer will be pointing to null.


[User] Please transcribe this text

[Assistant] And this is from the previous code, so we just have to remove this.


[User] Please transcribe this text

[Assistant] Now I'm including everything in the public section because I don't want


[User] Please transcribe this text

[Assistant] So this is the only one constructor, default constructor that we need. And then now we start off with the operations that is the functions of circular linked list.


[User] Please transcribe this text

[Assistant] We've already discussed the six operations that we're going to be implementing in the previous video. So we're going to be.


[User] Please transcribe this text

[Assistant] Doing append node, we're gonna be doing prepend node. We will do insert node after. We will do delete node. We will be printing the entire circular list.


[User] Please transcribe this text

[Assistant] And then this one is node exist, which checks if a particular node exists in the linked list or not because you're going to be needing it in other.


[User] Please transcribe this text

[Assistant] So we'll first start off with check if node exists. Now if you watch the singly linked list video or the doubly linked list in fact, pretty much the idea is the same. We pass in the key of a particular node. So let's take a visual representation.


[User] Please transcribe this text

[Assistant] Let's say we have three nodes, node n1, n2 and n3 as you can see in the diagram. So obviously the head node or the head pointer in the circular linked list object.


[User] Please transcribe this text

[Assistant] So now let's say we want to search for a particular node and let's say the key value that we pass in this method is 3. Now if you see the diagram, from the diagram you can see that n3 has the key value of 3, right?


[User] Please transcribe this text

[Assistant] So diagrammatically now we can say that this node exists with key value 3 that we are passing, but how do we programmatically check it? So let's see how the function goes. So first things first, we create a temporary pointer, okay, of node type and assign null to it.


[User] Please transcribe this text

[Assistant] Then we create one more pointer ptr of the same class node and we assign the head value to it.


[User] Please transcribe this text

[Assistant] That is now stored in this PTR printer, right? Now we are using this PTR to iterate through the entire circular linked list and you'll see how we do that.


[User] Please transcribe this text

[Assistant] So the first condition is if ptr equal equal to null. So when will ptr be equal to null? When the head value will be equal to null. And head value will be equal to null only when there are no nodes in the list, right?


[User] Please transcribe this text

[Assistant] So if there were no nodes, ptr would be null. But right now you can see that ptr and head both are pointing to n1, which means it is not null. It is having some actual address. So this if part is never going to be executed unless the entire circular linked list is empty. So the else part is going to be executed.


[User] Please transcribe this text

[Assistant] Now inside this else part, we're using a do-while loop. So you'll understand why we use a do-while loop, okay? Let me just explain why we are using do-while loop and not a while loop. Or any other loops.


[User] Please transcribe this text

[Assistant] So let's get inside the do while loop because the else part is executed and do while loop obviously we know that it executes for the first time before the condition is being checked, right? So it's a exit control loop wherein the condition is checked at the end, not at the start.


[User] Please transcribe this text

[Assistant] So obviously the first time it is obviously gonna run. So inside the loop what we are checking is if ptr of key equal equal to k.


[User] Please transcribe this text

[Assistant] Now the k value that we passed, we are assuming that we passed 3, which is the key value of n3. Our ptr right now is pointing to n1.


[User] Please transcribe this text

[Assistant] Now n1 of key is you can see from the diagram is 1. So we are checking if


[User] Please transcribe this text

[Assistant] And once key is equal to what key we've passed, and we know that one is not equal to three, so this if part is not gonna be executed.


[User] Please transcribe this text

[Assistant] So coming outside this if part we are saying ptr is equal to ptr of next. So ptr right now is pointing to n1.


[User] Please transcribe this text

[Assistant] So n1 of next is n2, so n2 address is now assigned to ptr. Okay, so.


[User] Please transcribe this text

[Assistant] You can see how we are traversing now, so now ptr is pointing to N2. And now the do while condition is checked over here. And it is checked as ptr not equal to head.


[User] Please transcribe this text

[Assistant] Now remember this is a circular linked list, right? So the last node is actually pointing to the first node, which means N3's next pointer


[User] Please transcribe this text

[Assistant] At the head again throughout by iterating the entire list, right? So right now ptr is pointing at n2. Now n2 is not equal to head, right? Head is n1. So again this do while loop will be executed. Now here we are again checking if ptr of key equals to k.


[User] Please transcribe this text

[Assistant] Right now PTR is pointing to N2. N2's key is 2 from the diagram.


[User] Please transcribe this text

[Assistant] 2 is not equal to 3. 3 is what we've passed over here, right? So again, this if block will not be executed.


[User] Please transcribe this text

[Assistant] Equal to head? No, right? ptr is right now pointing to n3, our head is n1. So again, this do while loop will be executed.


[User] Please transcribe this text

[Assistant] Now in this case, now ptr is pointing to n3, now the key will be matched, so the address that is


[User] Please transcribe this text

[Assistant] The address of n3 which is stored in ptr will now be stored in temp. Right? At the end now ptr will get incremented over here ptr is equal to ptr of next. Now remember I told you n3 is next is pointing to n1 only to complete the loop.


[User] Please transcribe this text

[Assistant] So here the match will be found and this do while loop will be exited and we will return this temp. Now temp value has the address of ptr which was pointing to n3, right? So this is why our method


[User] Please transcribe this text

[Assistant] Node exists returns a pointer of node class. So what we are returning is


[User] Please transcribe this text

[Assistant] So coming to why we used do-while loop. Now if we would have kept


[User] Please transcribe this text

[Assistant] While loop over here, what would have happened is first the condition would be checked, right? So let's try to actually again dry run this entire code. I'm just going to copy this.


[User] Please transcribe this text

[Assistant] And here I'm pasting the while loop. So what I'll do is I'll cut this.


[User] Please transcribe this text

[Assistant] Paste it over here. Okay, and now let's try to again dry run the same code. Again, we'll pass three only, right? So what will happen? A temp node will be created. We will assign null to it initially. Ptr will store the address of head.


[User] Please transcribe this text

[Assistant] So right now head is pointing to N1, so N1's address is stored in PTR.


[User] Please transcribe this text

[Assistant] Again we check if ptr equal equal to null. Obviously ptr is not null. So this if part will only be executed when the list is empty. So now we are going inside the else part.


[User] Please transcribe this text

[Assistant] So now if we check here while ptr not equal to head, first the condition is being checked. Now if you see we have assigned head value that is the address stored in head which is of n1.


[User] Please transcribe this text

[Assistant] We've assigned that same address to ptr, which means initially ptr always points to head.


[User] Please transcribe this text

[Assistant] So this while loop will never be executed, right? Because at the start only the condition is ptr not equal to head.


[User] Please transcribe this text

[Assistant] We are saying while ptr is not equal to head only then execute the while loop. But ptr is equal to head only initially. So this while loop will never be executed, right? So we will never iterate through the entire circular linked list.


[User] Please transcribe this text

[Assistant] And directly we will say return temp and return temp is actually storing null. So every time we will get null value.


[User] Please transcribe this text

[Assistant] Even though we know that there exists a node having the key of 3, this while loop will not execute and then the match will never be found and then temp will never have the ptr address, the current ptr address of n3. So this is why we have to use the do while loop. I hope you've understood and I also tried to show you the visual representation. So yeah, this was the node exist method.


[User] Please transcribe this text

[Assistant] Now the reason why we're returning a pointer is because we will use it in other functions, other operations. So let's move ahead and see the next operation, which is appendNode. So this method doesn't have a return type because we will be passing a node by address.


[User] Please transcribe this text

[Assistant] So I hope you know the concept of pass by address. If not, I have a proper clear video on pass by address, pass by reference and pass by value. I'll drop the link or you can also see a card.


[User] Please transcribe this text

[Assistant] So the new node that we want to append, now append always happens at the end, right? So if we already have three nodes, the new node that we pass will be appended at the end. Okay?


[User] Please transcribe this text

[Assistant] So let's see the conditions. So first things first, we check if the node exists or whatever new node we pass, it will also have a key value. So we'll have to first check if there is


[User] Please transcribe this text

[Assistant] Any other node inside the circular language with the same key value, right? And if, if it has, then we will say node already exists with the key value.


[User] Please transcribe this text

[Assistant] So that's why we use this node exist method that we just created to check whether the node already exists with the same key value or not. Because you don't want any new nodes with duplicate or same key values, right? We want the key value to be unique. So this if condition first checks for that. Now if there is no match, we will get a null return value from this node exist method, right? So then the else part will be executed. Now in the else part we are saying


[User] Please transcribe this text

[Assistant] If there are no nodes, then head will be null. So this is where we check if there are actually any nodes in the circular linked list or not. Because initially obviously we will not have any nodes in the circular linked list. So this condition checks if head equal equal to null.


[User] Please transcribe this text

[Assistant] Now if it is equal equal to null, which means head pointer is having null value. So we directly attach this new node as the head value only. So now the head pointer inside the circular linked list object


[User] Please transcribe this text

[Assistant] We'll be pointing to this new node, which is basically going to be the first node. Right?


[User] Please transcribe this text

[Assistant] And also remember that since this is a circular linked list, this new node which just attached as the head is also the last node because we only have one circular linked list node right now. So the next value or next pointer of the new node


[User] Please transcribe this text

[Assistant] We'll point back to itself, right, for the first time because it is only the first and the last node.


[User] Please transcribe this text

[Assistant] Nodes in the circular linked list. In that case, we have to again traverse till the end, right? So let's assume we have three nodes n1, n2, and n3 you can see in the diagram. So in that case, again, we take the use of a ptr


[User] Please transcribe this text

[Assistant] Address was there in head, we stored in ptr. So both ptr and head are pointing to n1. Now we are seeing while ptr of next not equal to head. So ptr of next is n2. n2 is not equal to head, right? So in that case, we are seeing ptr is equal to ptr of next.


[User] Please transcribe this text

[Assistant] So now PTR will point to N2. N2's address will be stored in PTR.


[User] Please transcribe this text

[Assistant] And this while loop will execute till we reach the end. So when we reach n3, when ptr is pointing n3, we will say ptr of next which is n3 of next.


[User] Please transcribe this text

[Assistant] So we've reached at the end of the circular linked list and this is the condition that is ptr of next not equals to head. So when it will be equal to head, this while loop will stop and we will basically have arrived at the end because now ptr will be pointing to n3 and now we have to append this new node n4 after n3, right? Because appending happens at the end.


[User] Please transcribe this text

[Assistant] So now we see ptr of next that is n3 of next equals to this new node. Let's say n4.


[User] Please transcribe this text

[Assistant] We also have to say newNode of next equals to head because now n4 will point back to the head because n4 is the end now.


[User] Please transcribe this text

[Assistant] Append node because we first have to check whether there exists a particular node.


[User] Please transcribe this text

[Assistant] A node pointer, we are storing the address of head and we are traversing till the end. So this is the same thing that we did over here, but we're doing this for another purpose. You'll understand it. So let's say there are three nodes right now in the circular linked list.


[User] Please transcribe this text

[Assistant] So ptr will be pointing to the head initially, then using this while loop we are iterating till the end. I just explained how this while loop works. So after this while loop.


[User] Please transcribe this text

[Assistant] So, if we have n1, n2 and n3, n1 is the currently assigned head, but when we say prepend, this new node will be attached before n1.


[User] Please transcribe this text

[Assistant] So this new node N4 is actually going to be the new head, right? So the last node, which is N3, which is currently pointed by this PTR,


[User] Please transcribe this text

[Assistant] Has to point to this new node, right? So that's why we say ptr of next equals to new node. So now n3 will point back to n4. Okay? And not n1.


[User] Please transcribe this text

[Assistant] Because N4 is now the first head node. So this line does that.


[User] Please transcribe this text

[Assistant] Then we say new node of next that is n4 of next equals to head. Head is pointing to n1, right? Still we haven't changed the address inside the head. So now n4 will point to n1. And lastly we say head equals to new node. So now head address that is the


[User] Please transcribe this text

[Assistant] So these are the steps we have to do in this particular order only. Otherwise the addresses will be mixed up and you'll not get the appropriate result. And now we can say node prepended. So this was the prepend node at the start.


[User] Please transcribe this text

[Assistant] Now one modification inside the else part that you can do is we've not mentioned if there are absolutely no nodes


[User] Please transcribe this text

[Assistant] What happens then, right? That condition was there in the append node. So this is that condition.


[User] Please transcribe this text

[Assistant] Equal equal to null. So let's copy that inside this else part. We'll just paste it over here and this all part goes over here in the second else. Okay. So we'll say node prepended over here. So that's a small change.


[User] Please transcribe this text

[Assistant] And this was basically the prependNode method. Let's move to the next one.


[User] Please transcribe this text

[Assistant] Insert node after a particular node in the list. So in this we require two parameters. First is


[User] Please transcribe this text

[Assistant] The node after which we want to insert the node. So insert node happens at a particular location. Let's see we have n1, n2 and n3 in the circular language currently.


[User] Please transcribe this text

[Assistant] But insert node after basically happens after a particular node, so obviously the start attachment is not gonna happen. We will always insert a node after a particular node. So after n1 and before n2 or after n2 and before n3 or after n3, right?


[User] Please transcribe this text

[Assistant] These are the places that we can attach a particular node. So first things first, we check if the node exists. But in this case, we are not using if else to check it. We are just storing the result of node exists and passing the key inside this pointer. So node exists method we created returns a pointer.


[User] Please transcribe this text

[Assistant] And returns the address if the node exists and returns null if it doesn't exist, right? That's how our node exists method works. So we will pass, let's say we will pass 3. Now we know in the diagram you can see n3 has the key value of 3. And this new node, let's say is n4. So you have to attach n4 after n3.


[User] Please transcribe this text

[Assistant] So in the else part, now again we have to check if node exists and now we are passing the key of this new node. So we first checked


[User] Please transcribe this text

[Assistant] Or we first got the position where we want to insert the node. So right now the node has to be inserted after n3 which is basically at the end.


[User] Please transcribe this text

[Assistant] But now we have to also check whether this new node's key doesn't match with any of the existing


[User] Please transcribe this text

[Assistant] We already have N3 with the same key, right? So we have to check for that. So that checking is happening in this if block.


[User] Please transcribe this text

[Assistant] Now if it is unique, that is N4 has a unique key, let's say right now the key is 4, so it is unique, then the else part will be executed. Now in the else part, we have two more conditions.


[User] Please transcribe this text

[Assistant] So right now the condition is we have to insert node at the end, right? Because we passed the key of 3.


[User] Please transcribe this text

[Assistant] N3 has the key of 3 and we have to insert N4 after this key which means after N3, right? So how do we check whether the insertion is happening at the end or whether the insertion is happening in between?


[User] Please transcribe this text

[Assistant] So this condition ptr of next equal equal to head will give us if the insertion is going to happen at the end. Why?


[User] Please transcribe this text

[Assistant] Because right now if you see PTR is pointing to N3, right? We got PTR pointing to N3 over here only. Right? We passed 3 over here. We passed node exist.


[User] Please transcribe this text

[Assistant] Key value of 3. Key value of 3 is only in N3. So N3's address is stored in PTR. So currently PTR is pointing to N3.


[User] Please transcribe this text

[Assistant] We know right now ptr is the last node in the circular linked list, so obviously the next pointer of n3 is going to point back to n1. n1 is the head node. So this means we are at the end.


[User] Please transcribe this text

[Assistant] So this condition, if ptr of next equal equal to head is the condition to be checked when the insertion is happening at the end. So if this is true,


[User] Please transcribe this text

[Assistant] We can say that the insertion is going to happen at the end. So we say new node of next equals to head. So n4 of next now points to n1.


[User] Please transcribe this text

[Assistant] And ptr of next, that is n3 of next now points to this new node. Okay, so that two linking are happened. And now you can see node inserted at the end.


[User] Please transcribe this text

[Assistant] But if this is not true, that is if ptr of next not equals to head, let's say we pass 2 over here, which means we want to insert node after node n2, but before node n3, right?


[User] Please transcribe this text

[Assistant] So in that case, ptr of next, that is n2 of next is not going to be equal to head because n2 of next is going to be equal to n3. n3 is not the head.


[User] Please transcribe this text

[Assistant] Equals to N4. So that linking is happening. And now we can see node inserted in between.


[User] Please transcribe this text

[Assistant] Okay, so this was basically insert node after a particular node in the list. I hope diagrammatically things are getting cleared. Coming to the next one, we have delete node by unique key.


[User] Please transcribe this text

[Assistant] So when we want to delete a node, we basically just delink it and not actually delete the object.


[User] Please transcribe this text

[Assistant] As I mentioned, we will be uniquely addressing or uniquely identifying each node by its key value. So that's why we have the key data member in the node class so that we can uniquely identify it.


[User] Please transcribe this text

[Assistant] So let's see how delete node by key works or delete or delink basically operation works. First things first, we will check if that node exists. So let's say we have n1, n2, n3 with 1, 2, n3 as the key values respectively. So if I pass 4 right now.


[User] Please transcribe this text

[Assistant] That node doesn't exist, so ptr will be having null. So if that matches, that is, if ptr is storing null, it means no node exists with the key value of k, which is something that you've passed.


[User] Please transcribe this text

[Assistant] If, if there is a match, then PTR will be storing an address. Let's say you pass 3.


[User] Please transcribe this text

[Assistant] N3 is having the key value of 3, so ptr will be pointing to N3. So in the else part, first things first, what we check is if head equal equal to null.


[User] Please transcribe this text

[Assistant] Now this is just a extra redundant condition that I'm checking because if ptr is not equal to null,


[User] Please transcribe this text

[Assistant] It means that ptr is pointing to some node in the circular linked list, which basically means that head cannot be null, right? There has to be some values. So I'm just checking it just because I had to do it if else and this is actually this is something that you can actually ignore it. So I'll just remove it and I'll start with this if condition only. So in the else part,


[User] Please transcribe this text

[Assistant] We come in the else part when ptr is not equal to null, which means ptr is pointing to some node in the circular linked list that has this matching key of k, right? So first things first, we check if this ptr matches the head value. Let's say we have n1, n2 and n3, right now you can see from the diagram.


[User] Please transcribe this text

[Assistant] And key value of n1 is 1. So if we've passed 1 over here, ptr will be pointing to n1. Also the head pointer will also be pointing to n1. So this will be a match, right? So basically we want to delete the head node itself. So this is where we have to go inside this if block. This entire if block. Now inside this what we have to do is we check if head of next equals to null. When will be head of next equals to 1?


[User] Please transcribe this text

[Assistant] When there will be only one node inside the circular linkage that is the head node, right? So in that case, we just assign null to the head pointer.


[User] Please transcribe this text

[Assistant] So let's assume we only have one node n1 in the circular linked list. n1's key value is 1 and that is matching with what we are passing. So we want to delete the very


[User] Please transcribe this text

[Assistant] Now if head of next is not equal to null, which means we want to delete the head because ptr is matching the head address, but we have


[User] Please transcribe this text

[Assistant] Okay, so this ptr is different and this ptr is different. In fact, you know what? I'll just change the names if you are getting confused. I'll just make it ptr one. Okay, so I create one more pointer. I assign head address and now.


[User] Please transcribe this text

[Assistant] I traverse till the end by using the while loop concept. We've seen this two times now. Till the ptr of next doesn't match the head, we will keep on progressing. We will say ptr


[User] Please transcribe this text

[Assistant] One is equal to ptr one of next. So initially ptr one will be pointing to the head node. Then it will be pointing to end two.


[User] Please transcribe this text

[Assistant] And that is head of next. Right now head is pointing to N1, so head of next is N2.


[User] Please transcribe this text

[Assistant] So head of next, that is n2's address is now being stored in ptr1 of next. So ptr1 of next is basically n3 of next. So now you can see what is happening.


[User] Please transcribe this text

[Assistant] So head will now point to head of next. Head of next is n2. So n2's address will now be stored in head.


[User] Please transcribe this text

[Assistant] And now head is pointed to N2. So now you can see we have completely delinked N1 from the circular linked list.


[User] Please transcribe this text

[Assistant] And the head object now is N2 and we will start from N2 only. Okay, so I hope you understood this. Now these two things or these two aspects were only when we were getting the match of head


[User] Please transcribe this text

[Assistant] That is only when we want to delink the head object or head node itself. What if we don't want or what if the node


[User] Please transcribe this text

[Assistant] Doesn't match the same that we pass over here. Let's say we have 3 nodes, n1, n2, n3. And, uh, we have 1, 2, n3 as their respective key values. And if we pass 2 or 3 over here. So in that case, the head node's key value that is 1 is not gonna match over here, right? So in that case, this ptr, let's say we pass


[User] Please transcribe this text

[Assistant] 3 over here, that is the last object. So ptr will be pointing to 3 now, n3. Right? So it will not be equal to head. So this entire if block will not be executed. We will directly go into the else part. So in the else part now what we have to do is we have to traverse till n3 again. And we also have to keep a track of the previous node of n3. So basically now we want to eliminate n3. Let's assume. So I'm creating a temp pointer. I'm creating a previous pointer.


[User] Please transcribe this text

[Assistant] We have previous pointer which is pointing to head, we have current pointer which is pointing to head of next, which means previous pointer is pointing to N1, current pointer is pointing to N2. Now if we've come till the else part, we already know that this if part did not get executed and we don't want to


[User] Please transcribe this text

[Assistant] Unlink the head node, which means we don't want to deal with n1, right?


[User] Please transcribe this text

[Assistant] Delete the head node. And if, if part is not executed and else part is executed, which means that we either want to delete n2 or n3. Now we've passed the key value of 3.


[User] Please transcribe this text

[Assistant] Okay, so now we are having temp equals to null, previous pointer is pointing to n1, current pointer is pointing to n2, which is head of next. Now we are saying current pointer is not equal to null. Obviously current pointer is not equal to null because it is storing the address of n2. So for the first time while loop will be executed. Inside that we are checking current pointer of key equal equal to k.


[User] Please transcribe this text

[Assistant] Current pointer is pointing to N2. N2's key is 2. The key that we passed k is 3. So this is not equal, right?


[User] Please transcribe this text

[Assistant] This if block will not be executed. We'll go in the else part.


[User] Please transcribe this text

[Assistant] In the else part we are saying previous pointer equals to previous pointer of next. Previous pointer was pointing to head initially. So now head of next is n2. So n2's address is stored in previous pointer. Current pointer will store current pointer of next. Current pointer was pointing to n2 which is head of next. But now it will say n3. Okay.


[User] Please transcribe this text

[Assistant] Again, we will come at the start of this while loop. The condition is checked while current pointer not equal to null. We just said that the current pointer is pointing to n3. So it is having the address of n3. So it is not equal to null. So while loop will be executed.


[User] Please transcribe this text

[Assistant] Inside this we are again checking current pointer of key equal equal to k. Now current pointer is pointing to n3. The key value of n3 is 3 and 3 is equal to k which is 3 that we passed. So now the evlock will be executed. In the evlock we are saying temp is equal to current pointer.


[User] Please transcribe this text

[Assistant] So we come out of this if block, else part is not going to be executed this time.


[User] Please transcribe this text

[Assistant] And again we come to this while loop and now we are checking if current pointer not equal to null. But we just assign current pointer as null. So now we will exit outside this while loop. Now from the diagram you can see the temp pointer is currently pointing to N3. Right?


[User] Please transcribe this text

[Assistant] And the previous pointer is pointing to n2, right? So now what we are seeing is previous pointer of next that is n2 of next is equal to temp of next.


[User] Please transcribe this text

[Assistant] Temp is pointing to N3. N3 of next is N1 because we have to complete the loop. So, last node will be pointing to the first node. So, temp of next is equal to N3 of next which is equal to N1's address. So, N1's address is now stored in previous pointer of next. That is N2 of next.


[User] Please transcribe this text

[Assistant] So now N2 is pointing back to N1, which means we basically just delinked


[User] Please transcribe this text

[Assistant] The last node, let's quickly go ahead when we pass key value of 2. So when we pass key value of 2 over here, we want to delete n2. Again n2 is not the head node, then this if block is completely gonna be excluded, it will not be executed. We'll come to the else part, we will say temp is equal to null, previous pointer is equal to head which is n1, current pointer is equal to head of next which is n2.


[User] Please transcribe this text

[Assistant] The key value of n2 is also 2, so it's a match in the first run itself. We will assign that current pointer.


[User] Please transcribe this text

[Assistant] To temp, so now temp pointer is also pointing to N2. We will make current pointer is null.


[User] Please transcribe this text

[Assistant] We will come out of if block, else block will not be executed. While loop will come to an end and again when we check current pointer not equal to null, we just made current pointer as null. Right? So this while loop will be exited.


[User] Please transcribe this text

[Assistant] So now, as you can see from the diagram, the previous pointer is pointing to N1, the temp pointer is pointing to N2, right? So, what we are seeing?


[User] Please transcribe this text

[Assistant] Temp of next, that is N2 of next, which is N3. N3's address is now assigned to previous pointer of next. Previous pointer is N1. So N1 of next will store address of N3. And now you can see that N2 is delinked from the list. So next time we will jump from N1 to direct N3 because N1 of next now stores the address of N3.


[User] Please transcribe this text

[Assistant] Last is updateNodeByKey. This is pretty basic. We just pass the unique key of the node and the new data. So I'll say new underscore data over here. Just copy this and


[User] Please transcribe this text

[Assistant] Change it over here. First, we check if the node exists with this particular key. Let's say we have n1, n2 and n3 and if you see the keys 1, 2 and 3 respectively, if you pass 4, obviously,


[User] Please transcribe this text

[Assistant] That node is not gonna be existing. So this method will return null. However, if you pass a particular key,


[User] Please transcribe this text

[Assistant] of a node which exists in the circular linked list, let's say 3, this ptr will point to that, and then we'll say if ptr not null, that is if ptr is pointing to a particular node in the circular linked list,


[User] Please transcribe this text

[Assistant] We will access the data and change it to this new data that we pass over here. Okay.


[User] Please transcribe this text

[Assistant] We'll first check if head equal equal to null, and we'll say no node exists in the singly linked list. If head is not equal to null, we will simply do a do while loop.


[User] Please transcribe this text

[Assistant] We will assign the head pointer's address to this temp pointer. We will just print head address over here for verification and then we will say singly linked list values. And inside the do while we will say cout. We will print the key. We will print the data and we will print the address of the


[User] Please transcribe this text

[Assistant] Next node. And then we have brackets and comma in between. And then we have this next node indication. And then we will say temp is equal to temp of next. And in the while condition, in the do while condition, we are checking if temp not equal to head. So obviously for the first time, temp is equal to head. That's why we are using the do while loop again. Okay. So these were the seven different methods.


[User] Please transcribe this text

[Assistant] We are just creating a menu driven program just like what we did in singly linked list and doubly linked list. So I'm not going to explain that again. It's just a.


[User] Please transcribe this text

[Assistant] So this is something that we've been doing throughout.


[User] Please transcribe this text

[Assistant] This is just us calling these methods that we just created in the class. Okay, so let's directly run this. I'm going to say compile and run. Okay, I forgot a semicolon over here. I made a little bit of syntax error.


[User] Please transcribe this text

[Assistant] Save this. Execute compile and run. Okay, so our program is running perfectly fine.


[User] Please transcribe this text

[Assistant] So the menu driven program is saying what operation do you want to perform. Select option number, enter zero to exit.


[User] Please transcribe this text

[Assistant] If I hit enter, I'm getting a message, no node in the singly linked list because we've not really attached any of the node.


[User] Please transcribe this text

[Assistant] Okay, so now I'm gonna say appendNode. If I hit 1, appendNode operation, I'm saying


[User] Please transcribe this text

[Assistant] Enter key and data of the node to be appended. So I'm saying key as 2, hit enter and the data as 20. Hit enter.


[User] Please transcribe this text

[Assistant] So now I'm getting the message node appended at first head position because initially our circular linked list was empty. So let's clear the screen. Hit seven and hit six, which is print. Now, if I hit enter, I'm getting head address of this address value. Then I'm getting singly linked list values of two, which is key, 20, which is data.


[User] Please transcribe this text

[Assistant] And the address of the next node which is basically pointing to the head node itself.


[User] Please transcribe this text

[Assistant] So for the first node, that is the very first node in the singly linked list or circular linked list,


[User] Please transcribe this text

[Assistant] We are getting the same address, right, because it is pointing back to itself.


[User] Please transcribe this text

[Assistant] And this is circular linked list, not singly linked list. I have not made the actual changes because I just copy pasted the code. Let me just change that.


[User] Please transcribe this text

[Assistant] Okay, I'm appending a node. I'm saying 2, enter and 20. Node appended at the first position. Let's do one more append. I'm gonna say 1. I'm gonna say 3 and 30. Or let's do 4 and 40 actually. Let's clear the screen and let's print the list.


[User] Please transcribe this text

[Assistant] So there you go, you can see now we have two nodes in the circular linked list, 220 and 440.


[User] Please transcribe this text

[Assistant] That is the node having key value of 4. It is the same address that is the head address. So the head address is 0x1615B0. The next pointer storing the address is the same of the head node. So you can see the last node is pointing back to the first node. Let's do a prepend. So prepend would be some, something coming before 220, right? So I'm gonna say option number 2 that is prepend. I'm gonna enter the key of 1 and the value of 10. That is data of 10. Hit enter.


[User] Please transcribe this text

[Assistant] 2 comma 20 and 4 comma 40, so the new head is this 1 comma 10 node.


[User] Please transcribe this text

[Assistant] And now the head address has changed to 0161AD0. And if you see in the last node,


[User] Please transcribe this text

[Assistant] So append node and prepend node is working. Let's do a insert node after and we will insert node after 2, but before this 4. So let's hit 3.


[User] Please transcribe this text

[Assistant] So enter the key of existing node after which you want to insert this new node. So you want to insert the node after 2. So I'm gonna hit the key of 2. So it's saying enter key and data of the new node. So it's gonna be 3 space 30. Hit enter. And there you go. You can see node inserted in between. So now let's do a print. I'm gonna say 6. And now there you go. You can see 1, 10, 220.


[User] Please transcribe this text

[Assistant] And now we have a 3 and 30 before 440. So we've successfully inserted.


[User] Please transcribe this text

[Assistant] This node N3 or 330 node between 220 and 440. Let's do insert node after at the end. So select option number 3.


[User] Please transcribe this text

[Assistant] We will insert after this node 4, right? So I'm gonna hit the key of 4. I'm gonna say 5 comma 50. Hit enter and now I'm getting a node inserted at the end. So if I print the list by


[User] Please transcribe this text

[Assistant] Option number six, there you go, one, one, two, three, four, and then we have five comma fifty, which is the newly added or newly inserted node. Let's do a delete node by key. Option number four.


[User] Please transcribe this text

[Assistant] Enter the key of the node to be deleted. I'm gonna hit 4 or 5. Let's read the last node. Hit enter. So I'm getting node unlinked with key value 5. Let's print the circular linked list values.


[User] Please transcribe this text

[Assistant] And now you can see I have 1, 2, 3, 4, but I don't have 5. Let's delete one more time. This time we will delete the third node, so I'm gonna pass the key of 3. Hit enter. I'm getting node unlinked with key value 3. Let's print, which is option number 6.


[User] Please transcribe this text

[Assistant] So now I'm getting one, two and directly four. So the third node has been unlinked. Lastly, we have update node. I'm going to hit five.


[User] Please transcribe this text

[Assistant] So it's saying enter key and new data to be updated. So let's update node having the key value of 4 with the new data of 110. Hit enter.


[User] Please transcribe this text

[Assistant] And there you go, you can see in the last node, which had the key value of 4, the new data is 110. Initially if you see over here, it was 40.


[User] Please transcribe this text

[Assistant] I hope you've understood this. If you've watched the singly linked list and doubly linked list, this definitely must be very easy to understand. Of course, as I mentioned, everything is being shared in the video description. All the code and explanation.


[User] Please transcribe this text

[Assistant] So yeaah, this was the circular linked list and thank you so much for watching, if you've made it so far.


[User] Please transcribe this text

[Assistant] Please subscribe if you haven't already. Share this video with your friends. Do give it a thumbs up. Do give it a like and let me know in the comments how this video was. So thanks for watching guys. See you guys in the next one. Peace.


[User] Please transcribe this text

[Assistant] Two days, that's all. That means three days ago, the two of you made the blob with two backs!


[User] Please transcribe this text

[Assistant] No, well, obviously the Pandora's box thing. I wanted to try and keep it secret, but you know, Phoebe was there when I opened it. I think that plus our relationship kind of stood by fate.


[User] Please transcribe this text

[Assistant] Last night was the worst night I've had in Survivor and I've been voted off twice in a season so that's a pretty high bar or low bar when you actually think about it.


[User] Please transcribe this text

[Assistant] And now Dave's sitting pretty with an idol in a majority alliance that has pushed myself, Sean and Lee, all the way to the bottom. I've got my work cut out for me on this one.


[User] Please transcribe this text

[Assistant] My game is in smithereens at the moment. I am completely stuffed. I have to fix this. I just don't know how I'm gonna steady the ship.


[User] Please transcribe this text

[Assistant] No, no, no, no, no, no, no, no. And now they are three best friends.


[User] Please transcribe this text

[Assistant] When I read my card, I could just imagine their voices and hear their voices in my head. That's so interesting. I can't wait to see everyone else's.


[User] Please transcribe this text

[Assistant] You and I never do things in halves and we knew that this time you were going to go out there to win. I feel it in my bones babe, you're going all the way.


[User] Please transcribe this text

[Assistant] We do have to send two Alliance members to exile.


[User] Please transcribe this text

[Assistant] The rocks are in columns and rows.


[User] Please transcribe this text

[Assistant] Last night was chaos. No, last night was anarchy. Complete and total anarchy. We were all over the place. I wanted to get rid of Henry.


[User] Please transcribe this text

[Assistant] But the sportier people, they wanted Michelle gone because Henry's good at challenges. But basically we spooked Henry because we split the votes.


[User] Please transcribe this text

[Assistant] So right now Henry's like a nuclear warhead just waiting to go off.


[User] Please transcribe this text

[Assistant] I have to now kick my Henry management into overdrive because he's becoming a desperate man and desperate men do dangerous things.


[User] Please transcribe this text

[Assistant] I am feeling really, really, really nervous at the moment. It's the first time I've felt like I'm in trouble.


[User] Please transcribe this text

[Assistant] This tribe, all they care about is strength. So I know that Henry's going to target Shonnie. But I'm not down for that plan. Right now I am closest with Shonnie and Harry. So I need to get rid of Henry. That's the goal.


[User] Please transcribe this text

[Assistant] Henry is intentionally trying to cause chaos. You know, the Harry vote in the First Tribal. Giving the idol to Matt Rogers. Targeting Sean. I don't know what else I need to say. I don't know how many different ways I need to paint the picture because he's very addictive.


[User] Please transcribe this text

[Assistant] I hope that finally, finally, people wake up to the fact that Henry is a huge threat and has got to go.


[User] Please transcribe this text

[Assistant] Otherwise, Henry is going to burn this tribe to the ground.


[User] Please transcribe this text

[Assistant] Alright, next round. We need to win this. Who was the best?


[User] Please transcribe this text

[Assistant] We've lost the immunity challenge and my to-do list today.


[User] Please transcribe this text

[Assistant] is to go around and make sure that everyone is voting out Henry tonight.


[User] Please transcribe this text

[Assistant] All these people can think about is the challenges. They are thinking with their muscles, not with their brains.


[User] Please transcribe this text

[Assistant] We're trying really hard to get them to understand. He is so dangerous.


[User] Please transcribe this text

[Assistant] Our pitch is that we split the vote between Henry and Zach so that Shonnie's name doesn't even come up and we can hold onto the idol for the next vote.


[User] Please transcribe this text

[Assistant] Everyone seems to be on board still with Voting Out Henry, and this is good by myself, Shonnie and Harry.


[User] Please transcribe this text

[Assistant] I'm hoping that after tonight's vote, we...


[User] Please transcribe this text

[Assistant] Finally have arrived at that destination that's taken us 12 days to get to. But this is the tipping point.


[User] Please transcribe this text

[Assistant] If everyone just kind of sticks to their guns, we can steady the ship.


[User] Please transcribe this text

[Assistant] Yeah, it's a good pitch. It's a really good pitch. Henry's really good at this game. As is Shonnie.


[User] Please transcribe this text

[Assistant] We are all really good at this game and that's why it sucks that we lose.


[User] Please transcribe this text

[Assistant] But hopefully tonight we'll walk out of here without the craziness that's going to continue to crack and split and divide this tribe.


[User] Please transcribe this text

[Assistant] Can I, can I make a suggestion? I think he put that before he sat down.


[User] Please transcribe this text

[Assistant] I know I've got about one second to quickly grab the clue.


[User] Please transcribe this text

[Assistant] And hopefully they aren't gonna realise that the wells move.


[User] Please transcribe this text

[Assistant] Nick's freaking out, which I think is so cute. I love seeing him run around sweating in his little short shorts. Love him.


[User] Please transcribe this text

[Assistant] This is actually the first idol I've ever found and it really couldn't have come at a better time.


[User] Please transcribe this text

[Assistant] I see myself working with these people in the future and that's how I want us to all get ahead. I'm a loyal girl, Jonathan.


[User] Please transcribe this text

[Assistant] I hope people don't forget that tonight and throw me under the bus as soon as they get the chance.


[User] Please transcribe this text

[Assistant] I know this is a tribe that values like strength, so that's definitely on my mind.


[User] Please transcribe this text

[Assistant] We lost the immunity challenge today and we're heading to travel again.


[User] Please transcribe this text

[Assistant] I do feel a little bit responsible being on the puzzle, but saying that there's no one better on the puzzle than Nick.


[User] Please transcribe this text

[Assistant] Right now, this tribe has Matt on the bottom and a majority six.


[User] Please transcribe this text

[Assistant] You have the original Vakama members. A.K.A. Brooke, Flick and Loki. They've been a solid force since day one. And myself and Shoni.


[User] Please transcribe this text

[Assistant] So, right now I have an opportunity to build a lot of trust within the Vakama core group.


[User] Please transcribe this text

[Assistant] So I can make the big move happen at a later date and take over this tribe.


[User] Please transcribe this text

[Assistant] This is a big, big play, and a massive risk. If Matt Rogers finds an idol, it could destroy my entire game. But if everything goes to my plan, Matt goes home, and I come back a hero.


[User] Please transcribe this text

[Assistant] Tonight I'm putting my trust in my light. But I'm also taking the huge risk right now.


[User] Please transcribe this text

[Assistant] First case scenario, Matt receives four clean votes and goes home. Uh, I return to this tribal hero and me and Shonnie actually make it into the next phase of this game. But it could also completely blow up in my face.


[User] Please transcribe this text

[Assistant] Uhm, it is an interesting idea. There's a lot of pros and cons to keeping Matt. Hypothetically, if you make it to merge, Matt's there, he's a huge threat to win the whole thing, which puts the target on him and less on other players. And I'm sure that's gone through everyone's mind.


[User] Please transcribe this text

[Assistant] At the same time, you've got a lot of allies on the other side format.


[User] Please transcribe this text

[Assistant] And he's got a lot of people to make the moves.


[User] Please transcribe this text

[Assistant] Sneaky is bad when they're against you.


[User] Please transcribe this text

[Assistant] But when they're on the same side, it's very, very useful. So keeping around someone like that is just as handy as keeping around a challenge threat.


[User] Please transcribe this text

[Assistant] If anyone thinks they're gonna strong arm me, then they got another thing coming.


[User] Please transcribe this text

[Assistant] Against the Tide 4 Alliance, AK and Brook were running out of options.


[User] Please transcribe this text

[Assistant] At camp, he searched in vain for an idol.


[User] Please transcribe this text

[Assistant] And a tribal council. AK prepared to meet his doom.


[User] Please transcribe this text

[Assistant] Knowing that Brooke and I are in the minority and Brooke winning today. The writing is on the wall. But, there was a twist.


[User] Please transcribe this text

[Assistant] But sadly, an honest flag is raised.


[User] Please transcribe this text

[Assistant] After the accountant AK, his number was finally up.


[User] Please transcribe this text

[Assistant] And Brooke was on her own at the bottom of the trine. By the left, who will be voted out tonight?


[User] Please transcribe this text

[Assistant] So Sean, you're the only person standing here who's made it this far in the game before. Does that give you an edge?


[User] Please transcribe this text

[Assistant] Tarzan, you and Moana, the only two haven't won immunity yet.


[User] Please transcribe this text

[Assistant] Once again, immunity is back up for grabs. For today's challenge, you're going to collect blocks one at a time and place them on a shelf while attempting to avoid a trip obstacle. If you hit the obstacle,


[User] Please transcribe this text

[Assistant] The goal is to stack your blocks so they spell the phrase Australian Survivor All-Stars. First person to do so wins immunity, safe from the vote.


[User] Please transcribe this text

[Assistant] Losers, tribal council, where one of you will become the 20th All-Star voted out of this game. Alright, let's get to it.


[User] Please transcribe this text

[Assistant] That shelf is attached to the obstacle. So if you hit the obstacle, the shelf will wobble and lose your stack.


[User] Please transcribe this text

[Assistant] Blocks drop. You need to pick them up. Take them all the way back to the barrel. Start again. Costing you valuable time. This is speed versus precision.


[User] Please transcribe this text

[Assistant] Goal is to spell the phrase Australian Survivor All-Stars. Brooke has her third block. Opening up her lead. Tarzan right there with her.


[User] Please transcribe this text

[Assistant] Just like that. Drops his stack. He's gonna need to pick them all up. Go back to the start. Letting Brooke open up her lead even more. Takes a lot of energy to high-step through that obstacle.


[User] Please transcribe this text

[Assistant] After 46 days out here, you might not have much of it left.


[User] Please transcribe this text

[Assistant] Very muddy field today. That's gonna get stuck to your shoes and make it even more difficult.


[User] Please transcribe this text

[Assistant] One mistake in this challenge. Be right back to the start.


[User] Please transcribe this text

[Assistant] Moana placing her 9th block. Sean on her 8th block. Brooke has a nice lead. Can she keep it?


[User] Please transcribe this text

[Assistant] Sean, looking for the right letter. If spelling is not your thing, this challenge could be a challenge. It's not my thing.


[User] Please transcribe this text

[Assistant] David realizing he made a mistake with the first word. It's gonna cost him precious time. Trying to prevent Brooke from wearing that necklace again.


[User] Please transcribe this text

[Assistant] Brooke, three blocks ahead of everyone else at this stage.


[User] Please transcribe this text

[Assistant] Someone is going home tonight. If you're worried about your safety in this game, you're gonna wanna push through.


[User] Please transcribe this text

[Assistant] All that high stepping through the obstacle. It's gonna wear you out. Gonna make it more difficult to concentrate. One lapse.


[User] Please transcribe this text

[Assistant] And Moana is the first to have a huge disaster. She knocks over her entire stack. She's going to have to start again. She's completely opened the door for Brooke. Now it's up to Sean to chase her down. That's how quickly things can change in this challenge.


[User] Please transcribe this text

[Assistant] Rook has her third word completed. She does not want to make a mistake at this stage.


[User] Please transcribe this text

[Assistant] Boys still working away because this is Survivor. Anything can happen. Sean trying to pick up the pace. She's completed her second word.


[User] Please transcribe this text

[Assistant] Brooke, starting to work on the last word. Alana's still collecting her blocks.


[User] Please transcribe this text

[Assistant] Sean really putting on the pace. She's working on her third word. It's all in the hands of Sean now. Can she chase down Brock?


[User] Please transcribe this text

[Assistant] Sean, working quickly now. It's a high risk strategy, but it's all they have left. They want to keep that immunity away from Brock.


[User] Please transcribe this text

[Assistant] Sean, desperate to stay in this challenge. Moving quickly now on that fourth word. Rook. In the zone.


[User] Please transcribe this text

[Assistant] Now she needs to make her way back to the start without knocking everything over. One wrong move and it's all over.


[User] Please transcribe this text

[Assistant] Where one of you will become the seventh member of our jury. It's gonna be you. Well done.


[User] Please transcribe this text

[Assistant] What goes on when the torches go out? Watch the jury villa where the game never ends. At 10play.com.au slash survivor or on the 10play app.


[User] Please transcribe this text

[Assistant] And AK voted out the last tribal council.


[User] Please transcribe this text

[Assistant] First of all, congratulations. Third individual immunity win in a row. Fourth for the season. And on a day when you said you needed it the most.


[User] Please transcribe this text

[Assistant] So Sean, I don't think we've seen a tighter alliance than this four go this deep into the game. But that's all coming to an end tonight.


[User] Please transcribe this text

[Assistant] Tarzan, you pride yourself on playing a loyal game. But you have no choice tonight. You're gonna have to vote for one of your alliance.


[User] Please transcribe this text

[Assistant] Are you worried about that tonight? That they have a lot more days together than you do with them?


[User] Please transcribe this text

[Assistant] Sir Brooke. You're guaranteed to see day 47.


[User] Please transcribe this text

[Assistant] If anyone has a hidden immunity idol and you want to play it, now would be the time to do so.


[User] Please transcribe this text

[Assistant] This is a hidden immunity idol and any votes cast for David will not count.


[User] Please transcribe this text

[Assistant] Toss in. Two votes toss in. One vote Sean. One vote left.


[User] Please transcribe this text

[Assistant] 20th person voted out of Australian Survivor All Stars and 7th member of our jury. Tarzan.


[User] Please transcribe this text

[Assistant] Well, the tough thing about this game is to get to the end.


[User] Please transcribe this text

[Assistant] You have to bury a few friends. Grab your torches. Stop. Head back to camp. Goodnight.


[User] Please transcribe this text

[Assistant] And now, there's no idol to protect him.


[User] Please transcribe this text

[Assistant] Has he finally come to the end of the road?


[User] Please transcribe this text

[Assistant] This looks like a job for fireplace tongs.


[User] Please transcribe this text

[Assistant] So yesterday we won the immunity challenge. I gave Matt Rogers my idol. He was going to expire, so I had to do it.


[User] Please transcribe this text

[Assistant] But now, I am on the bottom here, and I'm not certain in this tribe where I stand.


[User] Please transcribe this text

[Assistant] At the moment, I need to build trust with someone to move forward. I need to get numbers. I can relate to Nick and I really want to harness that connection.


[User] Please transcribe this text

[Assistant] It's all stars. I'm coming back trying to elevate my game.


[User] Please transcribe this text

[Assistant] I'm hoping Nick the Snake of Season 1 becomes his King Cobra. And we can move forward and absolutely blow this game apart.


[User] Please transcribe this text

[Assistant] Dude, I was on the bottom after that boat. I'm going, I'm going guns blazing if I'm on the bottom now.


[User] Please transcribe this text

[Assistant] But like, you're my number one. Dude, no question. I know Harry's your number one. No, no. Harry's, you're Harry's number one. I hope I'm your number one. Are you sure? Yeah, cool.


[User] Please transcribe this text

[Assistant] She's one of, you know, the strongest she brought in all the challenges, but she was showing her cards as in who she was with and yeah, I'm definitely surprised. Something went down last night.


[User] Please transcribe this text

[Assistant] That doesn't matter. We're playing survival, we're not playing who's the strongest and can hold a barrel.


[User] Please transcribe this text

[Assistant] Michelle, she's someone I can see working with me. She's gotta stay.


[User] Please transcribe this text

[Assistant] Sean, the best player to play the game that hasn't won. Without a doubt.


[User] Please transcribe this text

[Assistant] Shan can appeal to those trustworthy, loyal hero types, but she's also got a strategic mind.


[User] Please transcribe this text

[Assistant] Whatever has to be done, I'm going to see this game a lot.


[User] Please transcribe this text

[Assistant] I worked my butt off today and it's going to come to fruition right now with Sean going home.


[User] Please transcribe this text

[Assistant] Yeah, exactly. I want to move forward with a mixture of those things. But numbers is where I'm at. You need the numbers to advance in the game. Numbers is a thing that you can always count on.


[User] Please transcribe this text

[Assistant] And hopefully a direction that everyone can get on board with.


[User] Please transcribe this text

[Assistant] Do you think you have numbers tonight? It is survivor, people lie.


[User] Please transcribe this text

[Assistant] But I put trust in the people that I put trust in for a reason. And so I am confident.


[User] Please transcribe this text

[Assistant] Draw a picture and label it, I hear science. What are the five senses? Which sense is this book about? Share your ideas with a partner.


[User] Please transcribe this text

[Assistant] Tribal council last night went exactly how I wanted it to. Sean, I knew she was going to put the votes on Shawnee. Sending Shawnee home.


[User] Please transcribe this text

[Assistant] Yeah, I never questioned Sean. Sean's loyal to me. And Sean's my close ally. We're getting closer to the end. Maybe she's somebody I would like to work with on the top two. I just gotta keep her close.


[User] Please transcribe this text

[Assistant] It's gonna put me in a very good position to pick off the people I don't want to be at the end with.


[User] Please transcribe this text

[Assistant] I got Tarzan, who knows army's number one. I got Dave, who relies on me. I got Sean, my closest ally. They're all three are loyal to me.


[User] Please transcribe this text

[Assistant] I think the only thing that worries me is Sean and Dave.


[User] Please transcribe this text

[Assistant] She's someone I could take to the end to go to top two. So I need to make sure that Sharn is closer to me than what she is, David.


[User] Please transcribe this text

[Assistant] So yesterday, Dave told Tarzan and I about his idol. And he used it to bring Sean in, just to make sure she didn't flip on him.


[User] Please transcribe this text

[Assistant] Survivor, even though you're in an alliance, is an individual game. And my ticket to get to the end is playing a game that no one knows I'm even playing. And people have no idea who's pulling the strings. You just keep getting close to him. Yeah. Alright.


[User] Please transcribe this text

[Assistant] I'm putting the pieces in place so that Sean's loyal to me to the end. Just making sure everyone is where I want them to be. On my side.


[User] Please transcribe this text

[Assistant] And now, my next part of my plan is to take down the old Markham as the broken anchor.


[User] Please transcribe this text

[Assistant] Ak is the very big game player. Probably one of the most Switched off people here.


[User] Please transcribe this text

[Assistant] Brooke is a challenge beast and probably the best social player out here. But now it's time to take them out.


[User] Please transcribe this text

[Assistant] So right now, it's pretty simple. Four of us. Me, Dave, Sean, Tarzan. Two of them. Brooke and AK. And AK's gotta go.


[User] Please transcribe this text

[Assistant] Okay, he's a man of whispers, but he's also very strategically good at this game and that makes him dangerous.


[User] Please transcribe this text

[Assistant] It is a pretty ballsy move not to split the votes. If he plays an art or wherever they put votes on, he gets to go home. And that could be me, that could be Dave.


[User] Please transcribe this text

[Assistant] AK and Brooke are 100 million percent going to be idol-hopping.


[User] Please transcribe this text

[Assistant] I'm gonna have to try and somehow get a GPS and put it on him because we need to make sure AK doesn't find Noddle.


[User] Please transcribe this text

[Assistant] AK is vulnerable tonight. He knows that and he's searching around for idols.


[User] Please transcribe this text

[Assistant] He just walked up, got the whole walk barrel and slipped it. And then he said, there's no rice now.


[User] Please transcribe this text

[Assistant] Shan promised Brooke, Shonnie and I that if we don't go to rocks, that she will 100% work with us at the next Tribal Council.


[User] Please transcribe this text

[Assistant] I know that Moe's not working with me, Tarzan's definitely not working with me, and Dave is the person I want out of this game. That puts me in a tricky position.


[User] Please transcribe this text

[Assistant] Survive is a game that can turn in a minute, in a conversation.


[User] Please transcribe this text

[Assistant] At some point, the majority alliance are gonna have to break, and people are gonna form building blocks.


[User] Please transcribe this text

[Assistant] Rook and I are both on the chopping block. The saddest part about this though is if one of us win, it's more than likely the other one's going home. So, right now, if ever in this game, it's every man for themselves.


[User] Please transcribe this text

[Assistant] I know that my name's coming out of that urn tonight at Tribal Council. So right now I'm feeling vulnerable. But Survivor doesn't favour the strongest, the fastest, the fittest. It favours the bravest. No matter how much my back's against the wall, or the numbers are against me, I'm gonna bite my way back into the game.


[User] Please transcribe this text

[Assistant] There's only five people between me and half a million dollars, but it's never felt so far away.


[User] Please transcribe this text

[Assistant] Brooke won immunity. So I know, the votes are coming to me tonight.


[User] Please transcribe this text

[Assistant] Sharna's been playing the middle ground since Merge. And now that I'm on the bottom, she's not gonna want to work with me.


[User] Please transcribe this text

[Assistant] If the majority four were smart, they would understand. If I have a hidden immunity idol, then whoever Rook and I put votes on would be going home.


[User] Please transcribe this text

[Assistant] I need to go on an Easter egg hunt and find myself an idol.


[User] Please transcribe this text

[Assistant] I've never felt more frustrated in the game of Survivor than I do right now.


[User] Please transcribe this text

[Assistant] I'm so desperate to find an idol. And I've got Mo babysitting me.


[User] Please transcribe this text

[Assistant] So I'm doing everything I can to break my babysitter tag and get rid of Moana.


[User] Please transcribe this text

[Assistant] Because that's the only chance I have to come out at Tribal Council and have a hidden immunity idol wrapped around my neck.


[User] Please transcribe this text

[Assistant] The best thing about losing my babysitter is I've just bought myself at least 5-10 minutes without anyone tagging me.


[User] Please transcribe this text

[Assistant] David's a massive player and I don't put anything past him. So I'm presenting another plan to him and I'm hoping that appeals to him to make the move tonight.


[User] Please transcribe this text

[Assistant] I have not played for 43 days to just give up now. I love this game way too much to just roll over and die. And hopefully David will decide to take that move and send Sian home tonight.


[User] Please transcribe this text

[Assistant] That was really hard for me to jump today. It sucked.


[User] Please transcribe this text

[Assistant] And knowing that Brooke and I are in the minority and Brooke winning today, the writing was on the wall.


[User] Please transcribe this text

[Assistant] So what was it about the jump? Got a fear of heights and I've got a fear of water. So combining the two together sort of.


[User] Please transcribe this text

[Assistant] Scared the bejesus out of me to be honest. But you did, you overcame it.


[User] Please transcribe this text

[Assistant] Yeah, after about three minutes, that's what I keep replaying in my head. Three more minutes on that word puzzle and maybe I could have been wearing that necklace tonight.


[User] Please transcribe this text

[Assistant] That's the, uh, the funny part about this game is that, for my own game, I probably would have loved anyone else but Brooke to win that necklace.


[User] Please transcribe this text

[Assistant] But the human side of me and the relationship that I've built with Brooke.


[User] Please transcribe this text

[Assistant] I couldn't have been happier for her. And that's why when the challenge ended, I didn't want no pity party. I didn't want any attention. I wanted to celebrate the fact that


[User] Please transcribe this text

[Assistant] This girl's worn this necklace more times than David's worn a t-shirt in the game. And I'm concerned about the tan lines that she's gonna get from it.


[User] Please transcribe this text

[Assistant] Time for you to go. Cheers mate. I'm still pinching myself that I'm here for a second time. It's been a pleasure. All the best to the five of you. Especially Dave. But especially Brooke. You guys better be hungry! Gotta keep your head up! Yeah!


[User] Please transcribe this text

[Assistant] I was six days away from winning the title of Soul Survivor. It's so close but so far away.


[User] Please transcribe this text

[Assistant] I would love to see David or Brooke win this game. They've both played strategic games, social games, and they're both physical threats and have every attribute it takes to win this game.


[User] Please transcribe this text

[Assistant] I'm proud of the game I've played and to go down in a burning flame of glory, not so glory. I'll take it. There's no better way to go out.


[User] Please transcribe this text

[Assistant] There's a lot of voices, a lot, a lot of voices at the moment.


[User] Please transcribe this text

[Assistant] There's no clear, this is what we're gonna vote for. It's gonna be, ah, this is gonna be a messy one.


[User] Please transcribe this text

[Assistant] Yo, what's going on guys? Tanmay here for simple snippets and welcome back to another video tutorial on data structures and algorithms. And in this video tutorial, we're going to be implementing the singly linked list data structure. That is we're going to write a C++ program to implement singly linked list and its standard operations.


[User] Please transcribe this text

[Assistant] So before we start off with this topic, as you can see on the screen, these are some prerequisites that you need to know.


[User] Please transcribe this text

[Assistant] So number one is understanding of what is linked list and singly linked list.


[User] Please transcribe this text

[Assistant] So this is something that we have discussed in the previous two video tutorials of this DSA algorithm course.


[User] Please transcribe this text

[Assistant] That is this entire playlist. So I'll link that. If you're not sure, if you don't know what singly linked list is or what linked list is, just check that playlist and you can see all those topics in that playlist. The next three things are from C++ programming. So these are some concepts that you need to know because we're gonna write C++ code, right? So you need to know C++ objects and classes.


[User] Please transcribe this text

[Assistant] You also need to know what are pointers in C++ because we are going to be playing a lot with pointers and you also need to know the concept of dynamic memory allocation.


[User] Please transcribe this text

[Assistant] Now all these three video tutorials or three concepts or topics I have covered separately in my C++ for beginners playlist.


[User] Please transcribe this text

[Assistant] So I'll link that also, you can probably see a card on the top right corner. If you're not confident with that,


[User] Please transcribe this text

[Assistant] Just check that out because we're writing a code from scratch and all these concepts are gonna be used.


[User] Please transcribe this text

[Assistant] This is the way that we are gonna go ahead with and we've also theoretically discussed how we are gonna write the code in the previous video tutorial of this playlist.


[User] Please transcribe this text

[Assistant] I think this one is very easy. I've typed it from scratch. And the singly linked list operations that we're going to implement are these six.


[User] Please transcribe this text

[Assistant] And the printing of the entire linked list. Now there can be many more other operations. If you want, you can put them in the comments and maybe we can have a part two of this code also. And now that the introduction is completely done.


[User] Please transcribe this text

[Assistant] Let's get started with the coding because we have to write like around 200 to 300 lines of code to implement all these operations. Okay, so I'm just gonna erase this out. I have the basic structure. You can pause the video and type it out. I would highly recommend that you type the entire code along with me. So yeah, let's first create the node class.


[User] Please transcribe this text

[Assistant] So our idea is we will create node objects and then we will create another singly linked object.


[User] Please transcribe this text

[Assistant] And using that singly linked list object, we will link all those nodes. Okay, so first we have to write the class to create the node.


[User] Please transcribe this text

[Assistant] That is what we've discussed in the previous video, so I'm gonna say class node.


[User] Please transcribe this text

[Assistant] Now in the public section, I'm going to keep everything in public. I'm not creating separate private section for data members just to keep things simple. Now our node consists of three things. First is the key. So I'm going to say int key and I'm going to say int data. And the third thing is a pointer of the same type node.


[User] Please transcribe this text

[Assistant] Which points to the next node, okay. So remember this is the structure of our object that we will create and you can probably see a diagram on the screen also.


[User] Please transcribe this text

[Assistant] The key is gonna be unique to one particular node itself that is one object will have that one unique key and then no other objects can have that key. The data can be repetitive.


[User] Please transcribe this text

[Assistant] The reason why we keep key as unique is because then when we want to individually access one particular node, we will use that key. Okay? And as I mentioned, the next pointer


[User] Please transcribe this text

[Assistant] Is a pointer of type node, which is of the same class.


[User] Please transcribe this text

[Assistant] And let's create constructors also. I hope you know what are constructors. So I'm going to say node. This is default. So I'm going to say key equals to zero. Data equals to zero and next equals to null. Okay. So this is a default constructor. We are assigning key and data as zero zero.


[User] Please transcribe this text

[Assistant] So the address right now it is pointing to is null basically nothing. Okay. Let's create a parameterized constructor also. So I'm going to say node int k comma int d. We'll pass two arguments. We will say key is equal to k and beta is equal to d.


[User] Please transcribe this text

[Assistant] All the other operations and all the other working actually and the functionality is gonna be in the other class which is known as single English class.


[User] Please transcribe this text

[Assistant] Class, that is the object of class single in English.


[User] Please transcribe this text

[Assistant] We will link the objects of these nodes. So you'll get a clear picture as we move ahead. So let's just type along, just type along with me. So I'm gonna say class singly linked list. Okay. In the public section again, I'm keeping everything public.


[User] Please transcribe this text

[Assistant] And the member functions that is the methods as public, but I'm not going to do that because that will just increase our code.


[User] Please transcribe this text

[Assistant] Of node type, so this is the class that we created over here.


[User] Please transcribe this text

[Assistant] So that is the type of pointer. So node star, that's the syntax. And we're going to say head. Okay.


[User] Please transcribe this text

[Assistant] By default the default constructor will be called unless you are passing any arguments and in that case we want our head to point to null or store an address of null. Let's create one more constructor. But this time what we will do is we will create a constructor that takes address of a node object as argument. Okay, so in that case I have to say node star n.


[User] Please transcribe this text

[Assistant] So when you want to pass an address of a variable or an object, you have to use this syntax. So this is basically the pass by address concept.


[User] Please transcribe this text

[Assistant] I forgot to mention I have a video on pass by value versus pass by address versus pass by reference. In that I have clearly differentiated between the three. If you want go check that out that is a very


[User] Please transcribe this text

[Assistant] Arguments by address and you'll understand why we need to do that. I'll explain to you as we move ahead.


[User] Please transcribe this text

[Assistant] So when you pass a node by address, what we will do is, we will say


[User] Please transcribe this text

[Assistant] We will use the key of that particular node, right? So let's say I have two nodes in the singly linked list. One is having a key of 1 and another one is having a key of 2. And let's say I'm inserting a third node again with the same key of 1.


[User] Please transcribe this text

[Assistant] So that is an invalid entry, right? I cannot have multiple duplicate key values. So that's why I have to have a function or a method which checks for a particular node.


[User] Please transcribe this text

[Assistant] And depending upon whether it exists or not, we take some action. So that is why we have to create this method. So I'm gonna say node star


[User] Please transcribe this text

[Assistant] And inside this, I'm gonna pass the key. So int k is an argument, which will hold a key value.


[User] Please transcribe this text

[Assistant] And I'll tell you why I'm using this node star because this is


[User] Please transcribe this text

[Assistant] We will have to iterate or traverse to the entire singly linked list, right? So let's assume right now that we have


[User] Please transcribe this text

[Assistant] Three nodes in the singly linked list which are attached to each other in this format. You can probably see it on the screen also.


[User] Please transcribe this text

[Assistant] So we have to go from head node to the next one to the next one and when we go from each node, we have to check inside that node whether the key value of that node is what we are passing over here. That is this key. If it is yes,


[User] Please transcribe this text

[Assistant] Okay, this is what I'm gonna do first. This is the first line. So the next thing that I'm gonna do is


[User] Please transcribe this text

[Assistant] I'm gonna create one more pointer. I'm gonna say node star ptr. I'm gonna say equal to head. Okay.


[User] Please transcribe this text

[Assistant] Node exists, so this is a local pointer which exists only inside this method, right?


[User] Please transcribe this text

[Assistant] So what we will do is we will say in the condition of a while loop. So we are going to use a while loop to iterate through all the nodes. So I'm going to say while ptr not equal to null.


[User] Please transcribe this text

[Assistant] Head will be having the address of that particular node, right? And now here we are seeing that same address to be stored in.


[User] Please transcribe this text

[Assistant] Which means has to store the address which the ptr is storing. Okay. So this if part will only execute when the key value.


[User] Please transcribe this text

[Assistant] Of the node which the current pointer is pointing to matches with the key value that we passed. Okay.


[User] Please transcribe this text

[Assistant] Now we are checking for node value k of 2, okay. So we are checking for key value 2. So what will happen for the first time, let's say we pass 2 over here, a node temp will be created, node ptr will point to the head node. Now our head node over here is n1 node 1, which is having key value of 1. So for the first time,


[User] Please transcribe this text

[Assistant] Obviously PTR is not null, right? PTR is pointing to the head node, which is having some address, right? N1 is having some address, so it is not null, so while loop is gonna be executed. Inside that we will check PTR of key, which means the pointer


[User] Please transcribe this text

[Assistant] Now pointer is currently pointing to the head node only. So whatever address the head node has, head pointer has is also stored in the ptr pointer, right? So now we are checking using the ptr pointer we are accessing that object that is n1 for the first time.


[User] Please transcribe this text

[Assistant] And we are checking inside if the key is equal equal to k. Now we pass 2 over here.


[User] Please transcribe this text

[Assistant] The key for the first n1 node is 1. So it is not going to be equal, right? So this if part is not going to be executed. So after that what we will do is we will say ptr is equal to ptr hyphen next.


[User] Please transcribe this text

[Assistant] So we want to traverse from node n1 to node n2 also right. So in that case what we will do is we will use the same pointer and now inside this pointer we will store the address of the next node.


[User] Please transcribe this text

[Assistant] Right? Because you can see in N1, the next pointer inside N1 has the address of the node N2. So that address you will now store in ptr so that next time, that is the next iteration of the while loop, ptr will now point to N2.


[User] Please transcribe this text

[Assistant] Okay, and that's how we traverse the entire singly linked list by using the addresses and that's why we are using pointers.


[User] Please transcribe this text

[Assistant] So we are getting up until now what we've done. So once we exit this entire while loop, once we completely traverse the entire singly linked list, either the temp value will have an address or it will have null.


[User] Please transcribe this text

[Assistant] Depending upon whether you find the key or not, right? Because when the key will match the key inside of one particular node, only then this f part will be executed.


[User] Please transcribe this text

[Assistant] Only then the temp value will have some actual address, otherwise it will have null.


[User] Please transcribe this text

[Assistant] I'm gonna say void because obviously it's not returning any value. We're gonna be passing a node by address. So I'm gonna say append node.