[User] Please transcribe this text

[Assistant] This one's wounded. This vehicle's been destroyed. This way. Throwing snapshot! Throwing a stun grenade! Throwing decoy grenade! Throwing drill charge! Throwing flash grenade! Throwing grenade! Throwing knife here. Throwing molotov! Throwing septex! Throwing shock stick! Throwing smoke! Throwing tear gas! Throwing thermite! To your east. To your north. To your northeast. To your northwest. To your south. To your southeast. To your southwest. To your west.


[User] Please transcribe this text

[Assistant] Took a sniper round! Took out the mine! Took out their APC! Took out their armor box! Took out their bike! Took out their car! Took out their jet ski! Took out their jug! Took out their UAV! Tossing grenade!


[User] Please transcribe this text

[Assistant] Tossing smoke grenade! Transport hero down. Trophy system here. Trophy system online. Trophy system out. UAV tower here. Understood. Heading towards contract. Up top.


[User] Please transcribe this text

[Assistant] Upload station here. Use your mask! Gas incoming! Using drill charge! Using tear gas! Valuable here. Vehicle here. Vehicle marked. Visual on a stronghold.


[User] Please transcribe this text

[Assistant] Visual on tags. Visual on the device. Visual on the flag. Visual on the hostage. Want to join forces? Watch out! It's about to blow! Watching this sector. We control the SAM site. Get a field upgrade active here. We got air support here. We have a loadout drop here. We have a sentry here.


[User] Please transcribe this text

[Assistant] We have a Wilson here. We have an active field upgrade here.


[User] Please transcribe this text

[Assistant] We might have company. We planted a claymore here. We sent a drill charge here.


[User] Please transcribe this text

[Assistant] We threw a decoy grenade here. We threw a shock stick here. We threw tear gas here. Well fought. West, we've got more work to do. Let's go.


[User] Please transcribe this text

[Assistant] Aways out. Activating DDoS! Activating EMP! Activating suppression mine here! Active friendly recon up here. Advanced infantry here. Advanced infantry sighted. Affirmative. Affirmative. Eyes on the phone. Affirm. One more time. Ah, healing up!


[User] Please transcribe this text

[Assistant] Airdrop here. Airstrike tablet here. Air support kill streak here. Oh, too easy.


[User] Please transcribe this text

[Assistant] Almost. Almost out of large colobar rounds! Almost out of shells! Almost out of rockets!


[User] Please transcribe this text

[Assistant] Kisho! They chopped us! Battle rage here! Be alert! Enemy ammo box marked! Be seeing you! Below you! Bike marked! Bird marked! Black sights marked! Bomb drone active! Bomb drone deployed! Bounty sounds good. Buy me back! My blade is ready!


[User] Please transcribe this text

[Assistant] Clustermine deployed! Clustermine destroyed! Come fight with demons. Contract here. What say you? Contract phone here. Converso my mark. Copy. Copy. Elimination contract.


[User] Please transcribe this text

[Assistant] Copy, enemy spotted. Copy, extraction balloon. Copy, eyes on. Copy, eyes on the loadout crit. Copy, Geiger contract. Copy, gun safe contract.


[User] Please transcribe this text

[Assistant] Copy, I have visual. Copy, I see the loot cache. Copy, I see the vehicle. Copy, I see them. Copy, landing here. Copy, LZ. Copy, most wanted. Copy, standing by.


[User] Please transcribe this text

[Assistant] Copy, tag cable. Copy that. Copy, visual on by station. Copy.


[User] Please transcribe this text

[Assistant] Visual on the area. Copy, visual on boss. Copy, visual on the safe. Copy, visual on the SAM site. Copy, visual on the target. Copy, visual on the UAV tower. Copy, visual on the weapon case. Puppets and radiation blockers! Taking radiation meds! Could use a ride.


[User] Please transcribe this text

[Assistant] Counter UAV destroyed. Counter UAV eliminated. Cover deployed. Covering your six. DDoS here. Decoil grenade here.


[User] Please transcribe this text

[Assistant] Decoy mine here. Decoy mine set. Decoy out. Defender Objective Alpha.


[User] Please transcribe this text

[Assistant] Defend Objective Bravo. Defend Objective Charlie. Defend Objective Delta. Defend Objective Echo.


[User] Please transcribe this text

[Assistant] Defend Objective Foxtrot. Defend Objective Golf. Defend Objective Hotel. Defend the bomb. Defend the carrier. Defend the device. Defend the flag. Defend the HVI. Defend the objective. Defend the package. Defend the gear. Defuse Objective Alpha. Defuse Objective Bravo.


[User] Please transcribe this text

[Assistant] Diffuse Objective Charlie Diffuse Objective Delta Diffuse Objective Echo Diffuse Objective Foxtrot Diffuse Objective Golf


[User] Please transcribe this text

[Assistant] Defuse objective hotel. Defuse the charge. Defuse the device. Defuse the objective.


[User] Please transcribe this text

[Assistant] Defuse the objective. Defuse the package. Defuse the target.


[User] Please transcribe this text

[Assistant] Deployable cover here. Deploying cover! Deploying decoy! Deploying portable radar! Deploying Wilson. Destroy target Alpha. Destroy target Bravo. Destroy target Charlie. Destroy target Delta. Destroy target Echo. Destroy target Foxtrot. Destroy target Golf. Destroy target Hotel. Destroy the bomb.


[User] Please transcribe this text

[Assistant] Destroy the device. Destroy the flag. Destroy the HVT. Destroy the package. Destroy the target. Destroy the target. Destroyed their ammo box. Destroyed their drone. Dibs. Respect it.


[User] Please transcribe this text

[Assistant] Don't forget this! Don't worry, I've got you. Door's locked. Down low. Down range. Down this one.


[User] Please transcribe this text

[Assistant] Drill charge, get back! Drill charge here. Drill charge incoming. Drop point set. Drop zone marked. Send it! Dropped one. Dropped the sniper. Dropping ammo here. Dropping some armor. DZ marked. Air drop inbound. East. EKIA.


[User] Please transcribe this text

[Assistant] Elevator here. Eliminate the device. Eliminate the HVT. Eliminate the package. Elimination contact here.


[User] Please transcribe this text

[Assistant] Enemy advanced UAV marked. Enemy airdrop marked. Enemy airstrike here! Enemy airstrike is active! Enemy air support active in the AO!


[User] Please transcribe this text

[Assistant] Enemy air support marked! Enemy armor box destroyed! Enemy APC here! Enemy APC is down! Enemy armor box destroyed! Enemy armored boat destroyed! Enemy armored boat here! Enemy ATV down!


[User] Please transcribe this text

[Assistant] Enemy camera destroyed! Enemy car marked! Enemy care package marked! Enemy claymore here! Enemy cluster mine marked! Enemy contact! Enemy controls the SAM site! Enemy controls the UAV tower! Enemy counter UAV marked! Enemy cover here! Enemy covers down! Enemy cruise missile marked! Enemy decoy grenade marked!


[User] Please transcribe this text

[Assistant] Enemy dog tag here. Enemy drill charge marked. Enemy drone destroyed. Enemy emergency air drop marked. Enemy field upgrade marked. Enemy fighter here. Enemy fighter here. Enemy fighter marked. Enemy gun turret here. Enemy gunship destroyed. Enemy gunship marked. Enemy helo destroyed. Enemy helo gunner marked. Enemy here. Enemy in the AO. Enemy in the area. Enemy in the area.


[User] Please transcribe this text

[Assistant] Enemy KIA. Enemy killstreak marked. Enemy killstreak active here. Enemy lethal equipment here. Enemy loadout drop marked. Enemy marked. Enemy mortar team here.


[User] Please transcribe this text

[Assistant] Enemy recon drone marked. Enemy recon marked. Enemy riot shield. Enemy sentry down. Enemy shock stick marked. Enemy smoke here.


[User] Please transcribe this text

[Assistant] Enemy sniper! Enemy sound veil destroyed! Enemy special forces here! Enemy special mission units here! Enemy special mission unit marked! Enemy spotted! Enemy stealth bomber marked! Enemy suppression mine destroyed! Enemy suppression mine marked!


[User] Please transcribe this text

[Assistant] Enemy SUV Mocked. Enemy TAC Insert Offline. Enemy TAC Rover Mocked. Enemy Tactical Equipment Mocked. Enemy Tactical Insertion Destroyed. Enemy Tactical Insertion Here.


[User] Please transcribe this text

[Assistant] Enemy tactical's here. Enemy tank destroyed. Enemy tank is down. Enemy tank marked. Enemy tear gas here. Enemy thermite marked. Enemy transport helo destroyed. Enemy transport helo marked.


[User] Please transcribe this text

[Assistant] Day 45 and I am in final five of the All Stars and it's fantastic. I feel on top of the world today.


[User] Please transcribe this text

[Assistant] Last night at Tribal Council there was a twist. It allowed someone who thought they were in danger at the vote to nominate themselves for a fire challenge and save themselves from going home. AK put his hand up and nominated himself and everyone chose Moana to go up against him.


[User] Please transcribe this text

[Assistant] But Moana won, and as a result AK was sent from the game.


[User] Please transcribe this text

[Assistant] I can't believe that I've made it this far. I thought day one people would be gunning for me straight up, uh, and I can't believe they haven't taken me out yet.


[User] Please transcribe this text

[Assistant] So my next move will be how I'm going to get to the end of this game and who I want to get there with.


[User] Please transcribe this text

[Assistant] He's a dynamic player, he's smart, strategic. Taking Dave to the end could be seen by some as the biggest mistake you could make in Survivor.


[User] Please transcribe this text

[Assistant] But at the same time, such an all-star move to take such a big player to the end.


[User] Please transcribe this text

[Assistant] Then convince the all-star jury that they should vote for me.


[User] Please transcribe this text

[Assistant] I am not frightened of sitting next to David at the end. I'm going to convince that jury that's my biggest move and that's why I deserve the title of sole survivor.


[User] Please transcribe this text

[Assistant] Ah, look, I think having had that experience, sure, but it's a different game. There are different people, different dynamics. So, uh, yeah, it might give me a slight edge, but I reckon that's about it.


[User] Please transcribe this text

[Assistant] I am confident that the votes will be on Tarzan, but there's always a concern and a worry. It's survivor.


[User] Please transcribe this text

[Assistant] The people that we've got left in the game are some of the best players we've ever seen in Australian Survivor.


[User] Please transcribe this text

[Assistant] David is an excellent game player. He's always thinking about the long game. And at this stage, I'm not sure that David wants to take me to the end.


[User] Please transcribe this text

[Assistant] Right now, I'm voting for Tarzan, so is Moana. But if Dave decides to play an idol for Tarzan, Tarzan's gonna put a vote on me. I could be going home.


[User] Please transcribe this text

[Assistant] Tonight, if Brooke Moana and myself put the boats on Dave, even if he plays his idol for Tarzan, Dave will go home.


[User] Please transcribe this text

[Assistant] I'm basing my vote tonight on the fact that I want to get to the end. I'm not doing it to come second. It's not going to happen again. I'm here to win.


[User] Please transcribe this text

[Assistant] If Dave plays an idol for Tarzan, then Dave is going home tonight.


[User] Please transcribe this text

[Assistant] I am the last one in, in terms of the people that are here. They're all original Buccamers. I'm the only original Makuta here. So I do feel like I'm on the outer.


[User] Please transcribe this text

[Assistant] They've got those relationships that have been for that period of time. So yeaah, that is certainly something that I'm aware of.


[User] Please transcribe this text

[Assistant] And Henry handed the power over to Matt.


[User] Please transcribe this text

[Assistant] At Yellow Tribe Bakama, two distinct alliances had already formed.


[User] Please transcribe this text

[Assistant] David was leading the majority of seven, but he was here to settle a score.


[User] Please transcribe this text

[Assistant] Matt's alliance would put their votes on Daisy if David told them who his alliance was gunning for. And when Brooke found an idol, David had a plan to flush it.


[User] Please transcribe this text

[Assistant] And at one of the most epic tribal councils ever. There's seven of them. There's four of us. You just notice. Two of the games greatest players.


[User] Please transcribe this text

[Assistant] This is, in fact, a hidden immunity idol. Flushing Books Idol!


[User] Please transcribe this text

[Assistant] Twenty-one to left. Who will be going home tonight?


[User] Please transcribe this text

[Assistant] The green tribe, Makuta, getting their first look at the new yellow tribe, Bakuma.


[User] Please transcribe this text

[Assistant] So Henry, did you expect Daisy to be voted out last night?


[User] Please transcribe this text

[Assistant] John, you've played with Daisy before. You know her quite well. Why do you think they voted her out?


[User] Please transcribe this text

[Assistant] You're gonna face off, pushing against a heavy wooden box. Push your opponents into the water. Score a point for your tribe. First tribe to three wins reward. Wanna know what you're playing for?


[User] Please transcribe this text

[Assistant] Winning tribe will enjoy delicious, salty, fish and chips.


[User] Please transcribe this text

[Assistant] Alright, Makuti, you got an extra player you're gonna need to sit someone out. Cannot be the same person in back to back challenges. Who's it gonna be?


[User] Please transcribe this text

[Assistant] Alright, Michelle, you're on the bench. Everyone else, minutes to talk about it. Let's get to it.


[User] Please transcribe this text

[Assistant] Alright, here we go, first round. Makuta, who are you putting up? I'll give it a go.


[User] Please transcribe this text

[Assistant] Bring it on! Jackie, from the Yellow Tribe, Buckle up!


[User] Please transcribe this text

[Assistant] AK for Vakama. She's strong as shit, okay? Just be wary.


[User] Please transcribe this text

[Assistant] You got this, lids. Four time Olympian. Taking on the wedding DJ.


[User] Please transcribe this text

[Assistant] Go! Okay, big push right out of the gate.


[User] Please transcribe this text

[Assistant] Alright, next round. Makuta, who are you putting up? I think Hades. You're strong and unassuming.


[User] Please transcribe this text

[Assistant] We have Tarzan for the yellow tribe, Vakama.


[User] Please transcribe this text

[Assistant] Vakamo leads 2-1. First to three wins reward. Makuta needs to win it to stay in this challenge. God Harry. Survivors ready?


[User] Please transcribe this text

[Assistant] Ahri, Makuta's avoided going tribal the last two times. What happens in this game when a tribe keeps winning?


[User] Please transcribe this text

[Assistant] So Matt, what's this tribe gonna have to do to halt the progression of these guys?


[User] Please transcribe this text

[Assistant] For today's challenge, every member of your tribe is going to hold onto a rope attached to a heavy barrel.


[User] Please transcribe this text

[Assistant] If at any point you feel like you cannot hold up the barrel anymore, you can pass it to another tribe member. But, once you've handed over your barrel, you are out of the challenge. If anyone drops a barrel, the whole tribe is out of the challenge.


[User] Please transcribe this text

[Assistant] Last try, holding up all their barrels, wins immunity, safe from the vote.


[User] Please transcribe this text

[Assistant] Losing Tribe is a trip to Tribal Council where one of you will become the fourth All-Star voted out of this game.


[User] Please transcribe this text

[Assistant] Alright, Seanny, you're on the bench. Everyone else? Minute to talk about it, let's get to it.


[User] Please transcribe this text

[Assistant] Everyone's locked and loaded, holding out their heavy barrel.


[User] Please transcribe this text

[Assistant] 26 kilograms to be exact. Need to keep both feet behind the painted line.


[User] Please transcribe this text

[Assistant] If at any point you feel like you can no longer hold up your barrel, you can hand it to another tribe mate.


[User] Please transcribe this text

[Assistant] But if you hand it over too soon, you risk overloading the other person. If you wait too long, you risk dropping your barrel, sending your whole tribe to tribal council.


[User] Please transcribe this text

[Assistant] How you doing there, Henry? Not well. Not well? It's heavy. Yeah, you've been holding them up for five minutes now.


[User] Please transcribe this text

[Assistant] Everyone trying out different positions. What's more comfortable? Getting down low, standing up straight. Soon nothing's gonna be comfortable.


[User] Please transcribe this text

[Assistant] All it takes is one barrel to drop. Whole Tribe is out of the challenge.


[User] Please transcribe this text

[Assistant] Do not want to be the reason that you end up at tribal tonight.


[User] Please transcribe this text

[Assistant] Do you need me to take it? Shell handing her barrel to Zach. Shell out of the challenge.


[User] Please transcribe this text

[Assistant] Zack, the first with two barrels. Makuta, down to nine.


[User] Please transcribe this text

[Assistant] Lydia hands her barrel to Henry. Well done, well done God.


[User] Please transcribe this text

[Assistant] Immunity on the line, someone going home tonight. Fourth All-Star out of this game.


[User] Please transcribe this text

[Assistant] John, clearly struggling over there. How long can John hold two for?


[User] Please transcribe this text

[Assistant] Lydia with two barrels. Wow. It's the kind of challenge Lydia dreams about. Incredible.


[User] Please transcribe this text

[Assistant] If you're worried about your position in the tribe, you just gotta keep holding on. Shauna Michelle, out for Makuta. Phoebe out for Vakama.


[User] Please transcribe this text

[Assistant] Dax struggling to get his hand on the second ring in a very precarious position. That bad move.


[User] Please transcribe this text

[Assistant] Just believe in yourself, mate. All it takes is one barrel to drop. Your tribe is out of this challenge.


[User] Please transcribe this text

[Assistant] Now it becomes a mental game. Who can push through that pain?


[User] Please transcribe this text

[Assistant] You got it? Tarzan over to Jacky. Jacky back to David. David back to Locky. Lots of quick transfers now. Those transfers are going to be critical.


[User] Please transcribe this text

[Assistant] John struggling. Agony on his face.


[User] Please transcribe this text

[Assistant] Nick quickly jumps in. He's got nothing in the tank. Back to Abby, back to Lee. How much does Lee have in the tank? Looking very uncomfortable.


[User] Please transcribe this text

[Assistant] Nevertheless, tribal council tonight, where one of you will become the fourth person voted out of Australian Survivor All Stars. Grab your gear, head on out. I'll see you guys tonight.


[User] Please transcribe this text

[Assistant] At the risk of stating the obvious, Makuta's here tonight because you guys lost the challenge.


[User] Please transcribe this text

[Assistant] Zach, it looked like you gave it everything today. Do you think everyone else in the tribe did the same?


[User] Please transcribe this text

[Assistant] Michelle, you were the first to drop out. Do you think that might put a target on you tonight?


[User] Please transcribe this text

[Assistant] Do you think challenge performance is going to have an impact on tonight's vote?


[User] Please transcribe this text

[Assistant] Zack, if you lose someone tonight, who's strong?


[User] Please transcribe this text

[Assistant] Okay, once the votes are read, the decision is final. Person voted out will be asked to lead the tribal council area immediately. I'll read the votes.


[User] Please transcribe this text

[Assistant] Sean. Two votes Michelle, one vote Sean.


[User] Please transcribe this text

[Assistant] Sean, we're tied. Two votes Michelle, two votes Sean.


[User] Please transcribe this text

[Assistant] Henry. We're tied again. Two votes Michelle. Two votes Sean. Two votes Henry.


[User] Please transcribe this text

[Assistant] Henry. That's three votes, Henry. Two votes, Michelle. Two votes, Sean. Michelle. We're tied again. Three votes, Michelle. Three votes, Henry. Two votes, Sean.


[User] Please transcribe this text

[Assistant] Michelle. That's four votes Michelle, three votes Henry, two votes John.


[User] Please transcribe this text

[Assistant] Fourth person voted out of Australian Survivor All-Stars? Michelle.


[User] Please transcribe this text

[Assistant] Well, only time will tell if tonight's vote is the glue that will hold this tribe together, or the crack that'll tear it apart. Grab your torches.


[User] Please transcribe this text

[Assistant] Tomorrow night on Australian Survivor.


[User] Please transcribe this text

[Assistant] Or, will they find themselves back at Tribal?


[User] Please transcribe this text

[Assistant] As these all-stars prepare for the kill.


[User] Please transcribe this text

[Assistant] I dunno mate, at this stage of the game I'd be keeping the tribe strong, but...


[User] Please transcribe this text

[Assistant] Yeah, she's one of the stronger girls. But her emotions do do the talking, that's for sure.


[User] Please transcribe this text

[Assistant] You know, obviously having two barrels you had to account for as opposed to the other team's one.


[User] Please transcribe this text

[Assistant] They quite easily just moved it down their line, whereas, eh, we were depleted pretty quickly as a result.


[User] Please transcribe this text

[Assistant] Oh for sure mate, like none of us want to be here. None of us want to come back here either. But what Michelle's saying is definitely true.


[User] Please transcribe this text

[Assistant] We want to go into a swap situation and have people we can rely on.


[User] Please transcribe this text

[Assistant] Written by Gabriel Harper Illustrated by Matt Loveridge Focus Question How can things feel?


[User] Please transcribe this text

[Assistant] This feels so soft.


[User] Please transcribe this text

[Assistant] This feels so dry.


[User] Please transcribe this text

[Assistant] This feels so rough.


[User] Please transcribe this text

[Assistant] This feels so cold.


[User] Please transcribe this text

[Assistant] This feels so warm.


[User] Please transcribe this text

[Assistant] Connections. Writing and art.


[User] Please transcribe this text

[Assistant] Make a new sentence for the book.


[User] Please transcribe this text

[Assistant] Draw a picture and write this sentence. This feels so science.


[User] Please transcribe this text

[Assistant] Which of the four seasons are shown in this book?


[User] Please transcribe this text

[Assistant] Share your ideas with a partner.


[User] Please transcribe this text

[Assistant] Fine, Marge is always complaining I never fix things. Give me another. Alright, but we've run out of sugar cane. I carry my own.


[User] Please transcribe this text

[Assistant] Except that you're about to double cross some gangsters. Except that you're about to double cross some gangsters.


[User] Please transcribe this text

[Assistant] That's alright, brain. If I die, I'll be doing the thing I love the most. Trying not to get killed.


[User] Please transcribe this text

[Assistant] At least I'll die the American way, in a foreign country wearing short pants.


[User] Please transcribe this text

[Assistant] I can't believe you did that Bart. I don't even want to sit on the same side of his car with you. I'm just doing it for balance. I didn't shoot him. Oh yea? Well why'd you bring your slingshot? I don't know. I feel naked without it. Feel naked without it.


[User] Please transcribe this text

[Assistant] Get those objectives into a dead drop to make faction mission progress. Ultra, get those supplies into a dead drop to make faction mission progress. We don't have much time on this, move fast.


[User] Please transcribe this text

[Assistant] Exfil with those supplies to complete your active mission. Move.


[User] Please transcribe this text

[Assistant] Alright, well, on that note, I think it's time to vote. Okay, you're up.


[User] Please transcribe this text

[Assistant] Harry. Two votes Matt. One vote Harry.


[User] Please transcribe this text

[Assistant] Harry. What's high? Two votes Matt, two votes Harry.


[User] Please transcribe this text

[Assistant] Shawnee. Two votes Matt, two votes Harry, one vote Shawnee.


[User] Please transcribe this text

[Assistant] Matt. Three votes Matt. Two votes Harry. One vote Sean E. One vote left.


[User] Please transcribe this text

[Assistant] The worst thing that could possibly happen to this alliance is happening.


[User] Please transcribe this text

[Assistant] Tarzan is the most loyal player to ever play Australian Survivor.


[User] Please transcribe this text

[Assistant] Rook making it further than the last time she played has not been because we want her in the game. We have been desperately trying to get Rook out of this game, but she is a challenge beast!


[User] Please transcribe this text

[Assistant] And so am I, but physically I'm just a wreck. I am hungry, I'm tired as I'm sore.


[User] Please transcribe this text

[Assistant] I've never felt my body feel like this ever before. Which is why I'm in such a dangerous position. I have to tread very, very carefully.


[User] Please transcribe this text

[Assistant] If she wins the next individual immunity, I'm not going to final tribal council. I'm gone.


[User] Please transcribe this text

[Assistant] Coming out here the second time, I've devoted like a full year of my life to be out here. Trying to keep my head in the game, but it's been so much time away.


[User] Please transcribe this text

[Assistant] I like to say I'm playing for myself, I like to think I want that title, I want to be Soul Survivor, but I find myself thinking about my sons a lot.


[User] Please transcribe this text

[Assistant] I'm thinking about my daughter all the time and I'm thinking about my girl and uh, they're my motivation for being out here.


[User] Please transcribe this text

[Assistant] There's been so much I've missed because I've been away. I'd love to bring everyone home and have a place I could settle in.


[User] Please transcribe this text

[Assistant] Family's everything to me. I want to be closer to my family. And, uh...


[User] Please transcribe this text

[Assistant] That half a million dollars would reunite us as a family. I know I have to win this.


[User] Please transcribe this text

[Assistant] Man, I feel amazing, uhm, just to be able to perform for my kids, Winston, Hugo, Ray, uh, woah!


[User] Please transcribe this text

[Assistant] But man, this was such a huge one for me today. I had to win it. And, uh, yeah, here I am. Well, congratulations. Come on.


[User] Please transcribe this text

[Assistant] I'm so happy. It's a long time to give up to not win.


[User] Please transcribe this text

[Assistant] To be able to win for my daughter and for my wife who have just sacrificed everything for me this year. Uhm.


[User] Please transcribe this text

[Assistant] I've got more blood in the game this time. My family's out here riding with me. And, uh...


[User] Please transcribe this text

[Assistant] Brooke is a ferocious competitor, and I finally beat her.


[User] Please transcribe this text

[Assistant] Ugh. It's incredible man, I'm overwhelmed with emotions right now, so.


[User] Please transcribe this text

[Assistant] Tonight, Brooke goes home, and we are good. Heavy, heavy, heavy.


[User] Please transcribe this text

[Assistant] There's nothing that can happen, right? Like, I know I'm voting Brooke, you know you're voting Brooke.


[User] Please transcribe this text

[Assistant] For multiple tribal councils. But I've worked really hard on these guys, on this alliance. And we are clearly a tight three at this point. And that's why tonight, Brooke will go home.


[User] Please transcribe this text

[Assistant] Not in my wildest dreams actually, and I've had a lot of survivor dreams.


[User] Please transcribe this text

[Assistant] Uh, this is everything I've dreamed about, everything I promised my family, everything I've given up.


[User] Please transcribe this text

[Assistant] But slowly I kind of realised that this is All-Stars. People are here to play with targets. They're not just going after the big players. They want to play with the big players.


[User] Please transcribe this text

[Assistant] It's been amazing to watch. It's also been amazing to compete against her.


[User] Please transcribe this text

[Assistant] No matter who goes through to the final three, I think there's a pretty big chance that I won't be going through to the final two if I don't win the final immunity challenge.


[User] Please transcribe this text

[Assistant] But I know what's on the line, I know what's at stake, and I know I can win it. Monday night.


[User] Please transcribe this text

[Assistant] So, survivor, it's time for me to bring this home.


[User] Please transcribe this text

[Assistant] I expected to go somewhere between eighty to one hundred thousand dollars! Nobody touch it! Bart, stop looking at it!


[User] Please transcribe this text

[Assistant] Madam, are you saying this painting belongs to you?


[User] Please transcribe this text

[Assistant] My vote tonight is to keep the tribe strong, which way, you'll have to find out.


[User] Please transcribe this text

[Assistant] There's a simple plan where Lydia goes home. But also, I can't trust Matt.


[User] Please transcribe this text

[Assistant] Matt's been gunning for me for a while, so Lydia's coming to the right people to try to beg. I mean, it's All-Stars. Anything could happen.


[User] Please transcribe this text

[Assistant] People came over to us, there, there was massive fractions, I mean, and it just made the original Vakama, like, come together, I guess, cause there was a divide, and then we just pretty much chose which is the best course for us.


[User] Please transcribe this text

[Assistant] Expression of excitement, no, they're taking my intel.


[User] Please transcribe this text

[Assistant] Yeah, we had a law stating three strikes and you're out. But I thought it was, you're out. So I let people go. So now, it's four balls and you walk. Right to the electric chair. It's uh, much clearer Kent.


[User] Please transcribe this text

[Assistant] That was good. So AK, how does it feel to make merch?


[User] Please transcribe this text

[Assistant] It feels pretty awesome. There's four other people here that haven't made Merge.


[User] Please transcribe this text

[Assistant] There's five people here that were that close, then there's two runners up. So I think it's a pretty cool bunch.


[User] Please transcribe this text

[Assistant] I've made merch on all-stars, and I've played this game for the first 29 days exactly how I planned to. Smarter, not harder. And now,


[User] Please transcribe this text

[Assistant] I've gone from a 1 in 24 shot at half a million dollars to a 1 in 12 shot. And I'm ready to prove that I'm the best player of them all.


[User] Please transcribe this text

[Assistant] Everyone was already settled in over there. I'm stoked to be there. The sun's out, the water's fresh and I'm happy.


[User] Please transcribe this text

[Assistant] Shan has pulled me aside and tells me that that side of the alliance is voting for me tonight. Now I believe her because Shan has no reason to lie.


[User] Please transcribe this text

[Assistant] I'm just hoping my alliance keeps its nerve and votes the right way. Sean.


[User] Please transcribe this text

[Assistant] Well I thought when we hit merge that everyone would be talking to everyone.


[User] Please transcribe this text

[Assistant] But I had about four people here that didn't say boo to me after the challenge today. So I think it's like a lot of the other tribals I've been to. There's a clear, clear line already.


[User] Please transcribe this text

[Assistant] This tastes written by Gabriel Harper.


[User] Please transcribe this text

[Assistant] Illustrated by Andy Elkerton Focus Question


[User] Please transcribe this text

[Assistant] Draw a picture of your favorite food.


[User] Please transcribe this text

[Assistant] Use them to describe your favorite food.


[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 today's video tutorial, we're going to be taking a look at selection sort algorithm.


[User] Please transcribe this text

[Assistant] So yes, this is a sorting algorithm as the name suggests and if you don't know what sorting algorithms are, in the previous video tutorial of this DSA playlist, we've discussed in detail about what are sorting algorithms and why do we need them.


[User] Please transcribe this text

[Assistant] So I'll drop the link of this entire DSA playlist in the video description. If you want, do check it out. There are other topics in this entire playlist as well. And with that being said, let's get started with today's topic.


[User] Please transcribe this text

[Assistant] So let's start off with part 1. Let's try to quickly take a little bit of theory and understand selection sort algorithm.


[User] Please transcribe this text

[Assistant] We still have to discuss time and space complexities and the asymptotic notation concept in detail. We will do that further when we understand these basic sorting algorithms. So, I have a separate dedicated video for time and space complexity and that asymptotic notation concepts.


[User] Please transcribe this text

[Assistant] So the part one is the sublist of items that are already sorted and which is build up from the left to right. And the second part is the sublist of items which are remaining to be sorted.


[User] Please transcribe this text

[Assistant] That occupy the rest of the list. Now right now you will not clearly understand this point, but when we go ahead and see the working, you'll understand it very well. So just hold on for a few minutes and you'll understand this.


[User] Please transcribe this text

[Assistant] Next is initially the sorted sublist is empty and the unsorted sublist is the entire input list. And last point says the algorithm proceeds by finding the smallest or the largest of course depending upon the sorting order.


[User] Please transcribe this text

[Assistant] Again these points will not really make sense until and unless you actually see the working.


[User] Please transcribe this text

[Assistant] So when you apply the selection sort on this array, initially in step number 1,


[User] Please transcribe this text

[Assistant] We select the zero index position. Okay, and we check all the values and we compare it with this value. So we will start off from one. We will check the value at index position 125. If 25 is smaller than the value at position zero, we will make the swap.


[User] Please transcribe this text

[Assistant] So in that way our logic will go ahead and ultimately at position number 0, we will have the smallest value, right? So if you apply this in the first step,


[User] Please transcribe this text

[Assistant] Find the minimum element and place it at 0 position. If you see, if you compare the entire array, the minimum value is 11. So, this will be ultimately swapped at position 64 or position 0.


[User] Please transcribe this text

[Assistant] So if you see after step number one, on the left hand side, we have the very first element of the sorted subarray. So 11 is placed over here and on the right hand side, we have the unsorted subarray. So these are what the points were saying. We make two parts of the entire list or entire array.


[User] Please transcribe this text

[Assistant] So starting from the left we will slowly move ahead and in the next step we will select position number 1 and bring the smallest value at position number 1. Okay.


[User] Please transcribe this text

[Assistant] That is this subarray. The smallest value is 12. So now the 12 value is being kept at position number.


[User] Please transcribe this text

[Assistant] So now you have a complete sorted array using selection sort. So the reason why it is called selection is because you select index position at every step and you bring the minimum value at that index position from the entire array or list. Okay.


[User] Please transcribe this text

[Assistant] And that's why it is called in-place comparison sort. You select a place. So right now this is the place 0 position at step number 1. And you bring the minimum value at that position. Then you move that place 1 ahead. Now you are interested in position number 1. Then you are interested in position number 2. And here you are interested in position number 3.


[User] Please transcribe this text

[Assistant] Okay, so as you can see on this left hand side, we have the selection sort algorithm. Let me just mark it.


[User] Please transcribe this text

[Assistant] Okay, so this is the complete algorithm. We are taking the same example of integer array with size phi and the same elements. Now what we'll do is we'll go step by step and dry run this algorithm.


[User] Please transcribe this text

[Assistant] Then things will be more clear, okay? So we have our array named arr, so that's why name of the array. n is the size of the array, we know the size of the array is static, which is 5. So I have noted it over here.


[User] Please transcribe this text

[Assistant] So, if you observed in the previous slide or in the working explanation, we required 4 steps to perform sorting of an array with size phi which means


[User] Please transcribe this text

[Assistant] 4 steps, right? So just to show you, these were the number of steps that were required, right? 1, 2, 3 and 4.


[User] Please transcribe this text

[Assistant] So these steps are repetitive iterations, right? So that's why we are using a for loop and we require four steps to perform sorting of an array with size phi. So that's why we are saying i equals to zero, i less than n minus one. Now n is phi.


[User] Please transcribe this text

[Assistant] By the way, you can implement selection sort in multiple different programming languages. You don't need just one particular language. We are gonna be using C++ in the next video, but you can also implement it in Java, Python or any other programming language. Okay?


[User] Please transcribe this text

[Assistant] So this outer for loop over here you can see is basically for these larger steps or larger iterations. So we have four major iterations and inside that if you go inside the for loop if you see we have multiple steps and we have some smaller for loop also.


[User] Please transcribe this text

[Assistant] The inner for loop is for the comparison and checking. Okay? So let me just hide this again. Okay, so let's start off with the for loop because that is the starting point of this algorithm. So initially i equals to zero.


[User] Please transcribe this text

[Assistant] So let me write i equals to zero over here. Let me use another color. So i equals to zero.


[User] Please transcribe this text

[Assistant] So is 1 less than 5? Yes. So we go inside this for loop.


[User] Please transcribe this text

[Assistant] So arr of 0 is 64. Is 25 less than 64? True, right? So this is true. So now we go inside this if block and inside this if block we have this one statement.


[User] Please transcribe this text

[Assistant] Now again we are coming at end if, so we come outside the if block. We come at the end of the for loop, which is over here. From here we again go to the start.


[User] Please transcribe this text

[Assistant] So min value also becomes 2. Let me update it over here. We come outside the a block, we come at the end of the for loop and we again go to the start. Now again j equals to plus plus. So j now becomes 3. Is 3 less than 5? Yes. So we again go inside the for loop. Again the checking is happening. ar of j.


[User] Please transcribe this text

[Assistant] So now we exit outside this for loop completely because the condition has become false. So we come to end for.


[User] Please transcribe this text

[Assistant] And ultimately we come at this last step. Now here one last check is happening if min not equal to i.


[User] Please transcribe this text

[Assistant] So current element is at the zero position. Where is our min?


[User] Please transcribe this text

[Assistant] Min is not equal to i. So when it is not equal to i, we have to perform the swapping. And swapping is between ARR of min and ARR of i. Which is ARR of min is this and ARR of i is this. So we have to do this swapping. So 11 goes to 64's position and 64 goes to


[User] Please transcribe this text

[Assistant] And 64 goes over here. So this is step number 1. And at the end, after this swapping, you can see we come at the end of the for and this end for is basically for the outer for. So now we again go back to this for and now we are i++. So i now becomes 1.


[User] Please transcribe this text

[Assistant] Okay, so now again this process will completely start for step number two. So let's see how step number two goes.


[User] Please transcribe this text

[Assistant] Okay, so I've just erased everything and i has now become 1. So i is 1. Is i less than n?


[User] Please transcribe this text

[Assistant] What is n? n is 5. So we need to check i is less than n minus 1. So we need one step less, right? So 5 minus 1 is 4. Yes, 1 is less than 4, right?


[User] Please transcribe this text

[Assistant] So the new min value is 1, i value is also 1, min value is also 1. So now we are more interested in index position 1. Okay, so 0th position is done. We've brought the smallest value at the 0th position and now we are moving one step ahead. So we are more interested at index position 1.


[User] Please transcribe this text

[Assistant] Is 3 less than 5? Yes. So we go inside this for j has become 3, so I'll update it over here. We say arr of j, arr of 3 is 22. Is 22 less than arr of min? The new value of min is 2, arr of 2 is 12.


[User] Please transcribe this text

[Assistant] We will end if, we will end for, again come back, j++, j becomes 4.


[User] Please transcribe this text

[Assistant] Now we again check is arr of j which is arr of 4 which is 64 less than arr of min, arr of min is 2 which is 12, is 64 less than 12? No.


[User] Please transcribe this text

[Assistant] So this statement will not be executed, and if, and for again come over here, now jvalue


[User] Please transcribe this text

[Assistant] So 1 and 2 are not equal. If they are not equal, we have to perform the swapping. So we have to swap 12 with 25 and 25 with 12. So at step number 2, these two values will be swapped and this is how the result will look like.


[User] Please transcribe this text

[Assistant] So you can see 12 and 25 are being swapped. So again we will end this if we will end the last for that is outer for and we will come back over here. I was 1 again I plus plus will happen. So I will now become 2. So again a check will happen 2 is less than 4 only.


[User] Please transcribe this text

[Assistant] And then the condition will become false and we will exit outside the outer form and the algorithm will be stopped. Okay. So I hope you got a very good idea about selection sort algorithm.


[User] Please transcribe this text

[Assistant] We discussed a little bit of theory of selection sort, we saw the working also and ultimately we also saw the algorithm.


[User] Please transcribe this text

[Assistant] And we also dry run that algorithm so that we understand what happens step by step in the pseudo code of the algorithm.


[User] Please transcribe this text

[Assistant] You can also use any other programming language, whichever you are comfortable with, we are gonna be using C++. So thanks for watching guys, see you in the next one. Peace!


[User] Please transcribe this text

[Assistant] Have a good one, guys. Play hard, hey. Play really hard. Make big moves. Love you, see ya. Bye.


[User] Please transcribe this text

[Assistant] It'll be nice to let someone else decide when I drink. Too much pressure.


[User] Please transcribe this text

[Assistant] And with that tardiness, you have at last crossed the boundary where I can legally apply physical discipline. Willie! Cut me a switch!


[User] Please transcribe this text

[Assistant] Skate! Skate! As fast as you can! But I'll catch you! I'm the principal man! That's the kind of education you're missing.


[User] Please transcribe this text

[Assistant] Congratulations on your purchase of a Footmaster brand soccer ball. Thanks, Book!


[User] Please transcribe this text

[Assistant] I believe the sweet little girl in 21-D would disagree with you. What the?


[User] Please transcribe this text

[Assistant] Ah, Brazil, I couldn't stay afraid of you forever. The only thing that keeps me from living here is that fish that swims up your pee stream. That is a deal breaker. Homer Simpson.


[User] Please transcribe this text

[Assistant] Thanks, I still can't believe the yellow and red cards don't stand for mustard and ketchup. Your disbelief.


[User] Please transcribe this text

[Assistant] Yes, but knowing that Lisa chose me as her hero without ever considering any other hero keeps me strong. Why so quiet?


[User] Please transcribe this text

[Assistant] This is our hallway.


[User] Please transcribe this text

[Assistant] This is our


[User] Please transcribe this text

[Assistant] And I am a super rectangle. I can take many forms. Switch! I am six by two. Turn!


[User] Please transcribe this text

[Assistant] I am two by six. I am a rectangle.


[User] Please transcribe this text

[Assistant] First you need to stand so your front makes a rectangle shape.


[User] Please transcribe this text

[Assistant] Watch and tell me when I'm making a rectangle.


[User] Please transcribe this text

[Assistant] Rectangle! That's right, your blocks are arranged in neat columns and rows. Now concentrate on how wide you are. I am six.


[User] Please transcribe this text

[Assistant] Oh, I heard a ban. Are you okay, Six? I'm more than okay. I've mastered the way. Hey, where are my rays? You need to concentrate. It gets easier with practice. So let's practice. It's time for the turn.


[User] Please transcribe this text

[Assistant] I am twelve. I am three by four. Which means, ta!


[User] Please transcribe this text

[Assistant] Hey, hey, hey. What's all this? Look at us and be amazed. We all have rectangle rays. It's alright for some. I can't make big wide rectangles. Whoever said rectangles had to be wide?


[User] Please transcribe this text

[Assistant] Yeah, Bit, I'm kinda angry. I'm ticked off, man. She ruined both our games.


[User] Please transcribe this text

[Assistant] I'm ten times stronger going into all-stars than I was the first time. Outplay!


[User] Please transcribe this text

[Assistant] I just want to know if you think that that was a smart strategy considering you lied to a lot of us here on the jury and we're all going to determine your fate.


[User] Please transcribe this text

[Assistant] To me it seems like you're focused so much on getting to the top two. Rather than the damage you do to the jury.


[User] Please transcribe this text

[Assistant] I said great, awesome. Really? Yeaah. I was so happy for him and the opportunity and he had such an excellent time the first time. So I think it was a chance to do something incredible again.


[User] Please transcribe this text

[Assistant] Hey what's going on guys, Tanmay here for simple snippets and welcome back to another video tutorial on data structures and algorithms.


[User] Please transcribe this text

[Assistant] In this video tutorial, we are going to implement the counting sort sorting algorithm. So, this is the part two of counting sort sorting.


[User] Please transcribe this text

[Assistant] So if you've missed the first part, that's where we've discussed the entire working of the sorting by taking an example, by taking a diagram, by try running that algorithm and understanding visually how the entire algorithm progresses. So if you have no idea about how counting sort works, please watch that video. I will link this entire DSA playlist DSA course in the video description.


[User] Please transcribe this text

[Assistant] Do check that video out, but if you're just here for the code, if you're just here for the implementation, then this video is just for you. Make sure you watch this video till the end. And with that being said, let's get started.


[User] Please transcribe this text

[Assistant] If you're new to my channel, my name is Tanmay Sakpal and I do a lot of computer science and information technology video tutorials like computer programming, development, technology talks and a lot more on this channel.


[User] Please transcribe this text

[Assistant] So if that's something you're interested into, then definitely subscribe and turn on the notifications to get the latest updates and never miss out on such important topics.


[User] Please transcribe this text

[Assistant] Okay, so I've opened up my DayC++ IDE, that's where we're gonna write a C++ program.


[User] Please transcribe this text

[Assistant] To implement the counting sort sorting algorithm and on the right hand side in the black you can see the entire algorithm that we've discussed previously.


[User] Please transcribe this text

[Assistant] We just have to convert this into C++ code. You can use any other general purpose programming language. The algorithm is pretty much gonna be the same. And in fact, it is almost in the form of code. So it's easy to understand. We've talked about it in the previous tutorial.


[User] Please transcribe this text

[Assistant] Which is basically the template for, you know, C++ program. We have the int main which is the starting point of a C++ program. So execution starts from the main function.


[User] Please transcribe this text

[Assistant] So since it is int main, I've set return 0 and this is where we have to start with the coding.


[User] Please transcribe this text

[Assistant] So we'll create a separate function, user defined function over here on the top. But first let's set some default things. Let's take the array from the user. So first I'm going to create two variables in size, initialize it to zero initially.


[User] Please transcribe this text

[Assistant] Then the range which is gonna be 10. So we've talked about this range variable which is important in counting sort. The range basically tells how many unique elements are gonna be there in the array.


[User] Please transcribe this text

[Assistant] Now array can have multiple elements and they can have repetitive elements also, but the range specifies those


[User] Please transcribe this text

[Assistant] Unique elements and in our case, we've assumed that our range is gonna be from 0 to 9, which means we have 10 elements and that's gonna be the range. Okay, so I'm hard coding the value over here for simplicity purpose. The range is gonna be 10. The next thing is we will ask the user to enter the size of the array.


[User] Please transcribe this text

[Assistant] That is the input array. Then we will create that array. So for that we have this code, we say enter size of array.


[User] Please transcribe this text

[Assistant] We take in the size and then we create int myarray of that size. Now if you are on turbo C++, this code might not work.


[User] Please transcribe this text

[Assistant] Because dynamically setting the size of array is not allowed with certain versions of C++ with that version of compiler. If you have this DaveC++ IDE,


[User] Please transcribe this text

[Assistant] It should work. If not, then you can use the concept of


[User] Please transcribe this text

[Assistant] Dynamic memory allocation or for simplicity purpose, you can also hard code this size. In our case, we are taking the size from the user and then creating my array of that size. Okay. So if user enters 5, our my array is going to be of size 5. Now we have to take the individual elements from the user and store it in our array. So for that we have this code. We say enter size, which is going to be taken from the user.


[User] Please transcribe this text

[Assistant] So if it is 5, we will say enter 5 integers in any order.


[User] Please transcribe this text

[Assistant] Then we will run this for loop from i equals to zero to less than less than the size. So if the size is five, it will run from zero to four because array index starts from zero. We will take the input using scene operator and we will store it in my array. Okay, fair enough. This is easy enough.


[User] Please transcribe this text

[Assistant] Then we will print those values that we've taken from the user. We will say before sorting again run the same for loop from zero to less than size. But this time we say cout myarray and then we take a space and then we will say cout endl. So the cursor comes on the next line.


[User] Please transcribe this text

[Assistant] So this will print the unsorted random array, which will not have any sorted elements. It would be unsorted before sorting. After this, we will call our counting sort function, which we still have to create, which will have the entire algorithm. So it would be like counting sort. We will pass the array.


[User] Please transcribe this text

[Assistant] We will pass the size of the array and we will pass the range.


[User] Please transcribe this text

[Assistant] So three parameters you have to pass, you have to pass the array, the size of the array and the range. Okay?


[User] Please transcribe this text

[Assistant] And I'll tell you why we need this and we still have to create it over here. And lastly, we will print after sorting again for loop with zero to size and we will print the same my array.


[User] Please transcribe this text

[Assistant] So when we pass this my array in a function, remember in C++ whenever we pass an array, it is passed by address.


[User] Please transcribe this text

[Assistant] If you don't know what is pass by address, pass by value, pass by reference, do watch another video which covers that extensively. I have explained these three concepts in detail. I will link that video in the description or you can go check out my C++ for beginners playlist on our channel. Some important topics are covered over there as well.


[User] Please transcribe this text

[Assistant] So anyways, this is gonna be the entire thing in our main function.


[User] Please transcribe this text

[Assistant] Then we have int s which is representing size and int r is representing range. Okay, so this my array will be named as input array when we pass it inside this function.


[User] Please transcribe this text

[Assistant] Okay, so if you see the algorithm on the right hand side in the black,


[User] Please transcribe this text

[Assistant] The first step is to take the input array. This is that input array.


[User] Please transcribe this text

[Assistant] Second step is to create an output array of the same size as the input array, right? So let's create that.


[User] Please transcribe this text

[Assistant] We've also created the count array with the range value. So if you see the third step, we have to take the range which is r over here and we also have to create a count array obviously and initialize the count to zero. So that's step number four and four point one. So that's the first for loop, right? So hit enter over here.


[User] Please transcribe this text

[Assistant] And run the first for loop from int i equals to zero i less than range and we are saying count array of i equals to zero. So we are initializing.


[User] Please transcribe this text

[Assistant] 0 to all the elements in the count array for the first time. So this is the first for loop.


[User] Please transcribe this text

[Assistant] Now step number 5 and 5.1 is another for loop which basically


[User] Please transcribe this text

[Assistant] Increments the count at that proper index position whenever there is a occurrence of an element in the input array. So remember in counting sort, we are counting the number of elements which are repeated in the input array. So let's say our input array is of size 5 and in that we have 3 occurrences of the number 1.


[User] Please transcribe this text

[Assistant] So at index position 1 in the count array, the value will be stored as 3.


[User] Please transcribe this text

[Assistant] So all the elements in the input array are basically mapped to the indexes in the count array.


[User] Please transcribe this text

[Assistant] So this is something that we've discussed in the explanation also. So this for loop is basically doing that mapping and counting the number of instances of these unique elements in the input array and storing them at the appropriate indexes in the count array. And that is done by this code, which is for int i equals to zero i less than the size.


[User] Please transcribe this text

[Assistant] So size is basically size of the input array. So we're going to iterate through the entire input array. We will take the first element. We will go to the index position of that element in the count array and we will say plus plus. So count array of input array of i is incremented.


[User] Please transcribe this text

[Assistant] So this one line will do that mapping. So let's say we have five elements in the input array and


[User] Please transcribe this text

[Assistant] The first element is 1, so for the first time, we will take that 1.


[User] Please transcribe this text

[Assistant] So we will again come to the index position 1 in the count array and again increment it and this time it will be 2.


[User] Please transcribe this text

[Assistant] So this plus plus is doing that incrementing and this input array of i is giving or is taking that element from the input array and giving the exact index position in the count array. Okay. So after this entire for loop, we have all the counts of individual elements that are there in the input array. Okay.


[User] Please transcribe this text

[Assistant] So moving forward, now we have to calculate the cumulative values in the count array.


[User] Please transcribe this text

[Assistant] So you have to add the next element with the previous element and store it in the next element and this is done to give the positions of the elements in the input array.


[User] Please transcribe this text

[Assistant] To be placed in the output array to make it in a sorted way. So if this is confusing, if what I'm talking is not really understandable, I would again request you guys to please watch the part 1.


[User] Please transcribe this text

[Assistant] For those who have already watched it, you guys already know what I'm talking about. But for those who are just here for the code.


[User] Please transcribe this text

[Assistant] Just understand that we require this cumulative count to get the exact position of all the elements in the input array.


[User] Please transcribe this text

[Assistant] Which are gonna come in the output array. So in the output array we want everything in sorted format, right? So we want to place every element from the input array in the appropriate position. And that position is given with the help of this count array. So for that we need to do the cumulative addition.


[User] Please transcribe this text

[Assistant] So that cumulative addition is done by this for loop. Let me just add the comments to individual for loops. So the first for loop is to initialize all elements to zero.


[User] Please transcribe this text

[Assistant] Now after this for loop, this for loop obviously will run or start from 1.


[User] Please transcribe this text

[Assistant] And it will go to the range. So count array is of size range, right? So if the range is 10, which is going to be our case, our counter is going to be of size 10, which will be from zero index to nine index. So we are going to start from one because the first element that is the zero element cannot be added with its previous element. We don't have anything before zero.


[User] Please transcribe this text

[Assistant] So element at position 1 will be added with element at 0 and then the total will be stored at element 1 only.


[User] Please transcribe this text

[Assistant] Then we will move forward. So that's why we are starting from 1 and we will go till 9 which is less than 10 that is the range.


[User] Please transcribe this text

[Assistant] And the code is count array of i is equal to count array of i plus count array of i minus 1. So starting from 1, we will see count array of 1.


[User] Please transcribe this text

[Assistant] Is equal to count array of 1 plus count array of 0, which is i minus 1. And that will be stored in the


[User] Please transcribe this text

[Assistant] So this will give us the cumulative total which are basically gonna be the positions of individual input elements in the output array.


[User] Please transcribe this text

[Assistant] And for that we have the main for loop which is going to run from 0 to size. So 0 to the size of the input array or output array because input array and output array are of same size. So from 0 to S on the left hand side we have output array as the outermost array on the right hand side we have input array. So this is where we are doing the mapping. So we are placing input array elements into output


[User] Please transcribe this text

[Assistant] So on the right hand side, it is simple. We are saying input array of i. So we are picking one element from the input array, which is going to be starting from zero. So we'll take the first element.


[User] Please transcribe this text

[Assistant] On the left hand side we are seeing output array of count array of input array.


[User] Please transcribe this text

[Assistant] So we are taking the input array element, the first element basically, which is basically the index position in the count array.


[User] Please transcribe this text

[Assistant] So we will go to this index position of the count array returned by the input array.


[User] Please transcribe this text

[Assistant] Whatever value is there in the count array at that index position, we will do minus minus and that will give us the index position.


[User] Please transcribe this text

[Assistant] Complete itself in the output array. We will have everything in sorted format so we can run one last for loop.


[User] Please transcribe this text

[Assistant] Which will copy all the elements from the output array back to the input array. So copy output array elements to input array.


[User] Please transcribe this text

[Assistant] Obviously, this will run from 0 to the size of the input or output array from 0 to s that is less than s.


[User] Please transcribe this text

[Assistant] So input array of i is equal to output array of i and ultimately we will have the sorted input array and since this input array resembles our my array because my array is passed by address. So this my array is passed by address as input array. So it is one and the same thing. So my array will also now be sorted.


[User] Please transcribe this text

[Assistant] So let's save this and let's see if things work. I'm going to go to execute compile and run. Okay, so things are working fine.


[User] Please transcribe this text

[Assistant] Again 1, how many elements have we entered? 1, 2, 3, 4, 5, 6, 7. Okay. So, we have 3 instances of 1, we have 2 instances of 4, we have 1 instance of 5 and 1 instance of 6. Of course, the sorted array should be 1, 1, 1, then we have 4, 4, then we have 5 and 6.


[User] Please transcribe this text

[Assistant] From scratch, if you're a beginner, don't copy paste it. Obviously, I'm gonna share this code and...


[User] Please transcribe this text

[Assistant] All the theory on our official website, link in the video description, you can check it out.


[User] Please transcribe this text

[Assistant] But for the first time, do type it yourself for better practice.


[User] Please transcribe this text

[Assistant] Go ahead and play around with the different sizes of the array.


[User] Please transcribe this text

[Assistant] Our sorting will work perfectly fine. Okay, so that's it for this video guys. This was the counting sort sorting algorithm program. So this is the practical side of counting sort and this concludes our video over here. If you like this video, please give it a thumbs up. Let me know in the comments how this video was. Do share it with your friends. Do check out the DSA playlist. If you are new on this channel,


[User] Please transcribe this text

[Assistant] There are many more video tutorials on our channel. Definitely subscribe and stay tuned for the next video. Thanks again. See you in the next one. Peace.


[User] Please transcribe this text

[Assistant] That particular tribal council that nearly went to rocks. When you came back from the second vote, you told me to vote for Moe. And then when we got back to camp you denied it.


[User] Please transcribe this text

[Assistant] Okay, Dad's my hero. Why is he my hero?


[User] Please transcribe this text

[Assistant] No. My hero isn't famous.


[User] Please transcribe this text

[Assistant] Hey, what's going on guys? Tanmay here for simple snippets and welcome back to another video tutorial on data structures and algorithms. And as the title of the video suggests, today's topic is the conversion of an infix expression to a postfix expression using stack data structure.


[User] Please transcribe this text

[Assistant] So this is an important video where we are going to see one of the applications of stack data structure. One of the application of stack data structure is to make this infix to postfix and infix to prefix conversion. In this tutorial, as I mentioned, we're going to understand how a stack data structure can be used to convert infix expression to postfix expression. And before we start off with this topic,


[User] Please transcribe this text

[Assistant] I'm assuming you guys already know what is stack data structure, how it works. And I'm also assuming that you already know what is infix, what is prefix, what is postfix and the difference between these three expressions and why do we need them.


[User] Please transcribe this text

[Assistant] I have extensively covered all these topics in this tutorial series in this course. So I'm going to drop the link of this entire playlist. Do check them out. Do check out those topics. Those are very important so that you understand this one and in this tutorial, we're going to understand the rules that are applied when we want to use a stack data structure to make this conversion.


[User] Please transcribe this text

[Assistant] So if you've been following this course in previous tutorials, we've seen how to convert infix to postfix using the manual method.


[User] Please transcribe this text

[Assistant] But now we are gonna learn how a stacked data structure can be used and then later on we'll also see the algorithm in further parts.


[User] Please transcribe this text

[Assistant] So the goal of today's tutorial is to understand these rules, not just mug them up. I'm gonna show these rules on screen. You can probably see it, but we're gonna understand each rule.


[User] Please transcribe this text

[Assistant] By taking a comparison between the manual conversion and then the conversion using stack.


[User] Please transcribe this text

[Assistant] And then each rule will make sense. So make sure you watch this video till the end. This is a very important video. It's a application of stack data structure.


[User] Please transcribe this text

[Assistant] And it is kind of important from your exams perspective, from your interviews perspective and in general, it's an important topic. Okay, so with that being said, let's get started.


[User] Please transcribe this text

[Assistant] If you're new to my channel, my name is Tanmay Sakpal and I do a lot of computer science and information technology video tutorials like computer programming, development, technology talks and a lot more on this channel. So if that's something you're interested into, then definitely subscribe and turn on the notifications to get the latest updates and never miss out on such important topics.


[User] Please transcribe this text

[Assistant] Okay, so on the left hand side, you can see all the rules for infix to postfix using stack data structure. We'll go one rule at a time and we'll not just read it and not just mug it up. Our goal is to understand why that rule exists in that way. And on the left hand side, we have two columns. The first one is the question where we have to convert infix to postfix expression using the manual method.


[User] Please transcribe this text

[Assistant] And the same conversion on the right hand side, we're gonna do the conversion using the stack data structure. So since we've already done the manual method,


[User] Please transcribe this text

[Assistant] Let's see how this infix expression will be converted to its appropriate postfix expression and we'll see the steps and then we'll go rule by rule.


[User] Please transcribe this text

[Assistant] And perform this same conversion using stack data structure on the right hand side. Okay.


[User] Please transcribe this text

[Assistant] Okay, so since we've already done the manual conversion in previous tutorials, I've directly written the solution over here.


[User] Please transcribe this text

[Assistant] Now there are no brackets right now involved in this question. We will see another example where additional brackets are also involved and for that there are two more rules when it comes to using stack data structure.


[User] Please transcribe this text

[Assistant] But right now if you see when you are applying the manual process, manual conversion, what do you do? You apply the concept of operator precedence and associativity on infix expressions. So according to that,


[User] Please transcribe this text

[Assistant] B star C happens first, so that's what I have converted to postfix. Then we consider B star C as x1 and then later on we convert D divided by E because first preference is


[User] Please transcribe this text

[Assistant] B star C because the multiplication operator has the highest precedence compared to plus and minus and even division operator has higher precedence, but when you compare multiplication and division,


[User] Please transcribe this text

[Assistant] Both of them have same precedence, so in that case you apply associativity. And associativity says go from left to right.


[User] Please transcribe this text

[Assistant] So, the left side, we have star, so that's why multiplication is converted first. Then at step 2,


[User] Please transcribe this text

[Assistant] Division is converted to its appropriate postfix. Then this division part is considered as x2.


[User] Please transcribe this text

[Assistant] So this expression becomes A1 plus X1 plus X2. So X1 is a temporary placeholder for BC star. X2 is a temporary placeholder for DE divide by. Then later on again we have to convert


[User] Please transcribe this text

[Assistant] A plus x1 to its appropriate postfix format. So this becomes like this because plus and minus have same operator precedence. So again, we have to go from left to right using the associativity rules. So A x1 becomes postfix.


[User] Please transcribe this text

[Assistant] And then we consider a x1 plus as x3. So the expression becomes x3 minus x2. And then the minus comes over here and this is the final answer basically in the postfix format.


[User] Please transcribe this text

[Assistant] Then we just re-substitute x3, x2, we get this expression, we have x1 left, we substitute x1 back to BC star, and we get the final answer. Right? So this was just a quick explanation, but now we are gonna use


[User] Please transcribe this text

[Assistant] A stack data structure, on the right hand side you can see a stack data structure and solve this same question using these rules for conversion of infix to postfix.


[User] Please transcribe this text

[Assistant] So now the first rule says scan the expression from left to right. So we'll go from left to right. Rule number two says print operands as they arrive.


[User] Please transcribe this text

[Assistant] What are operands? Operands are these variables. Operands are constants. Operands can also be composite expressions, but they are not operators. Okay, operands are anything but operators. Operators are these special characters like plus, star, minus, divide by, raise to, those are operators. And I hope you know the difference.


[User] Please transcribe this text

[Assistant] So rule number two says print operands as they arrive. So let's write postfix over here.


[User] Please transcribe this text

[Assistant] So postfix version will come over here. We'll go from left to right. The first character in this expression string.


[User] Please transcribe this text

[Assistant] Okay, what do we have next? Next we have a plus. Plus is not an operand, right? Plus is an operator. So for that we have rule number three.


[User] Please transcribe this text

[Assistant] Rule number 3 says, if operator arrives and stack is empty,


[User] Please transcribe this text

[Assistant] Push this operator onto the stack. So this plus is taken and pushed onto the stack. So we'll write plus over here.


[User] Please transcribe this text

[Assistant] And this is the very first element in the stack. So this is how you push and this is how you pop, right? So push and pop happens from the same side.


[User] Please transcribe this text

[Assistant] And that's why stack data structure operates in first in last out manner or last in first out manner.


[User] Please transcribe this text

[Assistant] I'm assuming you guys know that. Okay, so we've pushed plus over here and then we move forward, right?


[User] Please transcribe this text

[Assistant] So the next character is again operand. It is B, right? So we already.


[User] Please transcribe this text

[Assistant] Covered A and we printed it over here in the postfix format in the postfix expression. Then we came across operator. We pushed it onto the stack because stack was empty. We push the operator and now we are at the third character. The third character is B. B is a operand.


[User] Please transcribe this text

[Assistant] The operators, we have to put it on stack when the stack is empty. It is because if you observe this result, when we did the manual conversion, we have a, b, c written as it is.


[User] Please transcribe this text

[Assistant] So that is exactly what we are getting in the postfix format also right now, right? We are at B, we printed B as it is. So in postfix remember,


[User] Please transcribe this text

[Assistant] The operators always come at the right hand side of the two operands.


[User] Please transcribe this text

[Assistant] That is the operators come at the end. So that's why the operands are coming first. The variables are coming first.


[User] Please transcribe this text

[Assistant] As we progress, you'll understand it more. So let's go from b to this next operator. The next operator is star. So now,


[User] Please transcribe this text

[Assistant] We again come at rule number three. Rule number three says if operator arrives and stack is empty, push this operator onto the stack. But now this rule doesn't apply because we already have one operator, right? So this is the top of the stack, right?


[User] Please transcribe this text

[Assistant] So the stack is not empty. So this rule number 3 will not apply. Let's see what other rule we have. Let's see rule number 4.


[User] Please transcribe this text

[Assistant] Rule number four says, if incoming operator has higher precedence than the top of the stack, push it onto the stack. Okay, let's analyze this. Let me read out again. If incoming operator, the incoming operator is now star operator. We are at this position, right? Right now we are at star character. So star character is an operator.


[User] Please transcribe this text

[Assistant] Rule number 4 says if incoming operator has higher precedence than the top of the stack. What is at the top of the stack? We have plus. What is incoming operator? Star.


[User] Please transcribe this text

[Assistant] That is multiplication. Does multiplication operator has higher precedence than plus operator? Yes. That's true right?


[User] Please transcribe this text

[Assistant] And the stack is also not empty, so rule 3 doesn't apply, rule 4 is coming true.


[User] Please transcribe this text

[Assistant] And when this happens, that is, if incoming operator has higher precedence than the top of the stack,


[User] Please transcribe this text

[Assistant] This star operator, right? That is this multiplication operator. This is the new top of the stack.


[User] Please transcribe this text

[Assistant] Now again, we need to understand why this rule exists, right? Because we are simply just reading it out and if you're wondering what logic does this make,


[User] Please transcribe this text

[Assistant] Let's progress ahead and then I'll explain why do we have this. So after star operator, the next character is a operand which is C.


[User] Please transcribe this text

[Assistant] So we are here and for this obviously rule number two applies that is print operands as they arrive. So we write down C, okay.


[User] Please transcribe this text

[Assistant] Now if you observe our original result that we did in the manual conversion, so these questions are the same thing, okay.


[User] Please transcribe this text

[Assistant] So a plus b star c minus d divided by e and the same question we are using.


[User] Please transcribe this text

[Assistant] Minus operator. So it is an operator, it is gonna go on the stack. But for this, let's see which rule applies.


[User] Please transcribe this text

[Assistant] So now again we will read rule number 4. We are saying if incoming operator has higher precedence than the top of the stack, push it onto the stack. The incoming operator is minus that we are currently scanning. The top of the stack right now is star operator.


[User] Please transcribe this text

[Assistant] Subtraction does not have higher precedence than multiplication, right? So obviously rule number four doesn't apply. Let's read out rule number five.


[User] Please transcribe this text

[Assistant] Rule number 5 says if incoming operator has lower precedence than the top of the stack, then pop and print the top of the stack, then test the incoming operator against the new top of the stack. Okay?


[User] Please transcribe this text

[Assistant] So this rule applies because the incoming operator which is minus,


[User] Please transcribe this text

[Assistant] Has lower precedence than the top of the stack. The top of the stack is multiplication. So minus has lower precedence than star. That is multiplication. So the rule says pop and print the top. So what is top? Top is star. So the star will be popped out and it will be printed in the postfix expression. So star will come over here. Let's write star. Okay, so it's popped out from the stack.


[User] Please transcribe this text

[Assistant] We popped and print, printed the top, so star came over here.


[User] Please transcribe this text

[Assistant] The incoming operator is still plus, minus, okay. So we have to test this with the new top of the stack. So now minus is compared with new top. The new top is plus because plus is still there.


[User] Please transcribe this text

[Assistant] So now we are going to compare minus with plus.


[User] Please transcribe this text

[Assistant] Now according to operator precedence, remember minus n plus half.


[User] Please transcribe this text

[Assistant] Same precedence, right? So they have same precedence.


[User] Please transcribe this text

[Assistant] In that case, what happens, we have to apply associativity. So for that, we have rule number six. Rule number six is, if incoming operator


[User] Please transcribe this text

[Assistant] So this is something that we've deduced, which means rule number 6 applies.


[User] Please transcribe this text

[Assistant] So what are these associativity rules are specified in 7 and 8. So for associativity of left to right.


[User] Please transcribe this text

[Assistant] So for plus and minus, remember we have to go from left to right. That's the associativity.


[User] Please transcribe this text

[Assistant] So rule number seven applies in this case. What do we have to do? We have to pop and print the top of the stack. So again,


[User] Please transcribe this text

[Assistant] This plus will be popped out and it will be printed over here. So I'm gonna write plus over here. Let's erase this plus from over here. We are at rule number 7.


[User] Please transcribe this text

[Assistant] We are saying pop and print the top of the stack. We've printed it over here, you can see.


[User] Please transcribe this text

[Assistant] And then it is saying then push the incoming operator. What is the incoming operator? Incoming operator is minus. So finally, this minus operator is now pushed into their stack. It's pushed into the stack. And this now becomes the new top of the stack. Okay.


[User] Please transcribe this text

[Assistant] We are pretty much correct on our path to getting this result.


[User] Please transcribe this text

[Assistant] We have ABC star plus and that is exactly what we have in the final answer of this question. We have ABC star plus.


[User] Please transcribe this text

[Assistant] So these rules are developed in such a way


[User] Please transcribe this text

[Assistant] That all the operator precedence and associativity rules are pretty much handled using these rules. Because over here if you observe, in step number two of the manual method,


[User] Please transcribe this text

[Assistant] b star c is first converted to bc star in the postfix format.


[User] Please transcribe this text

[Assistant] And that's why star has to be right after B and C. And if you observe in our


[User] Please transcribe this text

[Assistant] Stack conversion also, right after BNC we have the


[User] Please transcribe this text

[Assistant] Multiplication operator star and that is because of that rule where if incoming operator has lower precedence then the top of the stack we have to pop and print the top.


[User] Please transcribe this text

[Assistant] Because of this rule, we could achieve this BC star first. Okay? Anyways, let's move forward. We just did


[User] Please transcribe this text

[Assistant] The minus operator, so now we come at a character which is basically an operand.


[User] Please transcribe this text

[Assistant] For operand, the simple rule is print operand as they arrive. So we are just gonna print D. So I'm gonna write D over here. Then we move forward. The next character is division. So the incoming operator now is division.


[User] Please transcribe this text

[Assistant] So again, the rule applies, that is, rule number 4 applies, because if incoming operator has higher precedence, then the top of the stack, push it onto the stack. Division operator


[User] Please transcribe this text

[Assistant] Obviously has higher precedence than the top of the stack which is minus operator that is subtraction operator. So division operator is pushed onto the stack. So I'm gonna write division over here and this becomes the new top of the stack.


[User] Please transcribe this text

[Assistant] Now again we move forward in the infix expression string. The last character is, uh,


[User] Please transcribe this text

[Assistant] Basic operand, so for that print operand as they arrive, that's the rule. E. So I'm gonna write E over here.


[User] Please transcribe this text

[Assistant] And once we reach the end of the entire infix expression,


[User] Please transcribe this text

[Assistant] We have one last rule to be applied which is rule number line and it says at the end of the expression pop and print all the operators from the stack which are remaining. So operators that are remaining are popped and printed in that particular order that is last in first out.


[User] Please transcribe this text

[Assistant] We have pretty much arrived and got our final answer. And this is exactly the postfix expression.


[User] Please transcribe this text

[Assistant] That we get when we do the manual process also. So we can cross verify it and it is correct. And this is how using these simple rules we use the stack data structure.


[User] Please transcribe this text

[Assistant] We implemented the operator precedence and associativity in these rules and we applied it onto this infix expression using stack data structure.


[User] Please transcribe this text

[Assistant] By using the unique properties of this data structure which is last in first out and the operations that is push and pop.


[User] Please transcribe this text

[Assistant] And that's how we were able to make these conversions of infix to postfix. Now if you have noticed so far, there were no explicit brackets being used.


[User] Please transcribe this text

[Assistant] And remember, in operator precedence, the brackets has the highest precedence. Which means,


[User] Please transcribe this text

[Assistant] When a bracket is explicitly added, let's, let's say for example,


[User] Please transcribe this text

[Assistant] We have this expression, but now suddenly I say that a plus b should happen first. Now in general, what would have happened? b star c would have happened first, but since I've added brackets, a plus b should happen first, which means I'm completely changing the order in which the operation should happen. And that would obviously change the postfix expression as well. So for this scenario, let's take a second example.


[User] Please transcribe this text

[Assistant] Which will have brackets and then we will have two simple more rules when we are involving brackets. So let's see that.


[User] Please transcribe this text

[Assistant] Okay, so this is question number two and if you observe question number one was pretty much the same exact infix expression, but it did not have brackets. So over here we've added set of brackets extra to completely change the output.


[User] Please transcribe this text

[Assistant] Now over here you can see the inner most bracket is C minus D which means it happens first. So that's why in the manual conversion you can see.


[User] Please transcribe this text

[Assistant] C-D is converted to CD-, that is, to its postfix expression first, because, as I mentioned, brackets has the highest priority.


[User] Please transcribe this text

[Assistant] Then we consider cd- as x1, so the expression becomes a plus b star x1 divided by e. Now again, we also have the outer brackets of this and this.


[User] Please transcribe this text

[Assistant] That is this and this. So everything inside this will be evaluated or converted first and inside this we have two operators plus and star.


[User] Please transcribe this text

[Assistant] So among these two operators, obviously the star has higher precedence. So that's why b star x1 happens first. So we convert it to postfix bx1 star. Then we consider bx1 star as x2. So we get a plus x2.


[User] Please transcribe this text

[Assistant] That is in brackets. Now if we didn't have these green brackets, the outer brackets, x2 divided by e would have happened first. Rather than a plus x2, right? Because division operator has higher precedence than plus operator. But since a plus x2 is in brackets,


[User] Please transcribe this text

[Assistant] It is converted first to its postfix format, that is AX2+, and then we get X3.


[User] Please transcribe this text

[Assistant] Which we consider as Ax2+, so ultimately we are left with x3 divided by e.


[User] Please transcribe this text

[Assistant] Then we re-substitute all the temporary variable values.


[User] Please transcribe this text

[Assistant] To the first question's output of postfix expression, it is completely different.


[User] Please transcribe this text

[Assistant] And this is the result of using these explicit brackets.


[User] Please transcribe this text

[Assistant] So obviously we need some extra rules to handle these brackets, right? Otherwise when we use this same expression,


[User] Please transcribe this text

[Assistant] And when we use the stack to do the conversion, the expression will become wrong if we do not have some extra rules. So let me just write down a, b, c, d over here. That is this output, I'll write it over here.


[User] Please transcribe this text

[Assistant] Okay, so at the bottom you can see I have added rule number 10 and rule number 11.


[User] Please transcribe this text

[Assistant] Which is two extra rules for the symbol that is opening bracket and the closing bracket.


[User] Please transcribe this text

[Assistant] So rule number 10 says if incoming symbol is opening bracket, push it onto the stack. Pretty basic.


[User] Please transcribe this text

[Assistant] Then the next rule says if incoming symbol is a closing bracket, pop the stack and print all the operators till opening bracket is found. And then what you do is you just discard this closing parenthesis or closing bracket, okay.


[User] Please transcribe this text

[Assistant] So let's see these rules in action because that's how you understand it better.


[User] Please transcribe this text

[Assistant] And because of these brackets, as I mentioned, the entire postfix expression is going to change. So let's start off with the rule number one, that is scan the expression from left to right. Let's use green color now. Okay, so from left to right, we're going in this direction. The first thing is a opening bracket.


[User] Please transcribe this text

[Assistant] For that rule number 10 is there, we say if incoming symbol is opening bracket, push it onto the stack. So let's push opening bracket onto the stack. So this is the top of the stack now. Let's move forward.


[User] Please transcribe this text

[Assistant] The next character is a operand, a variable a, so it has to be printed as it is.


[User] Please transcribe this text

[Assistant] So let's print it as it is. Let me use another color. Let's use something bright. Okay, let's use blue.


[User] Please transcribe this text

[Assistant] So we'll write our postfix expression here. In fact, let me just erase this out.


[User] Please transcribe this text

[Assistant] Our expression needs to look like this. So let's write postfix over here and let's print out A as it is. Okay, let's move forward. The next is a plus operator. Okay, so for plus operator, which rule will be applied? So if you observe,


[User] Please transcribe this text

[Assistant] Rule number 3 is if operator arrives and stack is empty, push the operator onto the stack. So this does not apply. However, in this unique scenario, since the top of the stack is a bracket, it obviously has higher precedence than the plus operator.


[User] Please transcribe this text

[Assistant] And plus operator is now gonna be pushed onto the stack and this is going to be the new top of the stack. Now the reason why this happened is there is no direct rule for this.


[User] Please transcribe this text

[Assistant] But the reason why we push this operator onto the stack even when it was not empty and even when


[User] Please transcribe this text

[Assistant] Plus has less precedence than, than a bracket that is for this basically.


[User] Please transcribe this text

[Assistant] Rule number 5 should have applied, right? Rule number 5 says if incoming operator which is plus in this case has lower precedence than the top of the stack. Obviously plus has lower precedence than brackets according to our precedence rule.


[User] Please transcribe this text

[Assistant] But here we are talking about operators. Brackets are not binary operators. They are just used to decide which part of the expression can be evaluated first. They are not directly involved in the operation. That's why we are not considering them as operators itself.


[User] Please transcribe this text

[Assistant] Specifically opening bracket, you just push that operator onto the stack. Okay. By the way, you can take a screenshot of all these rules.


[User] Please transcribe this text

[Assistant] And use them to solve a few more examples manually as well as using the stack data section for the best practice and then you can compare the two results.


[User] Please transcribe this text

[Assistant] To cross check whether you're going correct and then that would be a little bit more intuitive and you'll understand it better. Okay, but anyways moving forward after plus operator.


[User] Please transcribe this text

[Assistant] I'm gonna write b as it is. After b we have another operator star. Okay, so for star rule number four will apply if incoming operator has higher precedence than the top of the stack and star operator obviously has higher precedence than the top of the stack which is plus. So in that case rule number four will apply as I mentioned and we just have to push it onto the stack. So star is pushed onto the stack. So I'm gonna write star over here.


[User] Please transcribe this text

[Assistant] And this becomes the new top of the stack. And then we move forward in the infix expression. Now when we move forward, we get one more opening bracket.


[User] Please transcribe this text

[Assistant] So remember for that rule number 10 happens, that is if incoming symbol is opening bracket, push it simply onto the stack. So our stack is getting filled up, right? So let me just, you know, make it spacious.


[User] Please transcribe this text

[Assistant] Okay, so this new opening bracket is now again pushed onto the stack. Simply push it because this now becomes new top of the stack.


[User] Please transcribe this text

[Assistant] We move forward, we have operand C, it is printed as it is. Rule number two applies, print operands as they arrive. Then we move forward, we have a minus operator.


[User] Please transcribe this text

[Assistant] So again, whenever a new operator arrives and if the top of the stack is a opening bracket, you just push that operator onto the stack. Okay, so minus is directly again pushed onto the stack. We have minus coming over here. So this becomes new top of the stack and don't assume that our stack is full.


[User] Please transcribe this text

[Assistant] It's just because we don't have extra space above. Let me just draw a little bit of the stack. Okay. So minus is again pushed onto the stack.


[User] Please transcribe this text

[Assistant] Then we move forward, we have D. D is operand, D is printed as it is. Let's write D over here.


[User] Please transcribe this text

[Assistant] So our postfix expression is pretty much building up. If you see the result of manual conversion, we have A, B, C, D.


[User] Please transcribe this text

[Assistant] So we have got ABCD right now and our stack is pretty much stacked up. And this is basically the new top now. It's filled with operators. But after D, if you see, we have a closing bracket.


[User] Please transcribe this text

[Assistant] So now rule number 11 will be applied. 11 says if incoming symbol is a closing bracket, pop the stack and print operators till opening bracket comes and then just pop the opening bracket as well. So since a closing bracket has come, we pop the stack, that is we remove the top of the stack. What is the top of the stack? Minus. So we erase out this minus.


[User] Please transcribe this text

[Assistant] And we obviously print it. So pop the stack and print the operators. So printing operators happens. So I'm going to write minus over here printing it in the postfix expression till a closing bracket is found. So when we pop first time minus came out, then the new top of the stack is opening bracket.


[User] Please transcribe this text

[Assistant] So that's the condition to stop, right? Till the opening bracket is found. So opening bracket is found over here. So we will stop and we will pop this.


[User] Please transcribe this text

[Assistant] Use in our postfix expression. We don't want any brackets in our postfix expression. So we'll just erase it off. And now the new top is the star operator. Okay. So I hope you have understanding so far.


[User] Please transcribe this text

[Assistant] We are at this closing bracket. Now let's move forward. We have another closing bracket.


[User] Please transcribe this text

[Assistant] So when we get one more closing bracket, again this rule number 11 will be applied. It says if incoming symbol is closing bracket, which is true, we are getting one closing bracket.


[User] Please transcribe this text

[Assistant] Pop the stack and print the operators, operators which means multiple operators, till again an opening bracket is found.


[User] Please transcribe this text

[Assistant] So right now the top of the stack is star. We will pop it off and print this operator. So star will come over here. Let's erase this. So new top becomes plus.


[User] Please transcribe this text

[Assistant] So this also has to be popped, right? We have to print all the operators till a opening bracket is found. So this is also popped. This was the top. This is also popped. So plus comes out.


[User] Please transcribe this text

[Assistant] And plus is also printed, right? Pop the stack and print operators. So plus comes over here. So we'll erase out plus. Pretty much stack is empty now. The new top of the stack is a opening bracket now.


[User] Please transcribe this text

[Assistant] And now we again stop because we have to pop and print all the operators till


[User] Please transcribe this text

[Assistant] Closing bracket, that is the last closing bracket. We still have two more characters left. So we move forward, we get a division operator. So we just put it onto the stack. So now this becomes new top of the stack, right? Okay, we'll move forward. We get E. E is an operand. So we just write E as it is. Okay. And now we are at the end of the infix expression.