It's fun when you get into it. Yeah. It's hard. It's hard. The first few times. Ready? I'm ready. Hello, and welcome to the ProduceMate Simple Kitchen. I'm Amelia. And I'm Fallin. And today we're here to talk all about Ontario Greenhouse Tomatoes. Ontario Greenhouses grows so many different kinds of tomatoes, from cluster to beef steak, grape, and cherry. Traditional heirloom tomatoes are also available, not to mention all the different varieties that are being naturally developed every day. So be sure to keep an eye out. And once you bring these tomatoes home, make sure you're storing them properly. People always complain that tomatoes have little to no flavour, but really it's due to how they're storing them. For optimum flavour, you should always keep your tomatoes on the counter in their original packaging. In fact, the packaging is so sophisticated these days, it keeps your tomatoes fresher for longer. Be sure to go to ProduceMateSimple.ca for loads of great fresh tomato recipes. Some of the recipes you can try using fresh greenhouse tomatoes are Spiced up Ontario Greenhouse Vegetable Pasta, Shakshuka, Fresh Marinara Sauce, Basic Tomato Salsa, and Fresh Ontario Greenhouse Tomato Basil Soup. Thanks so much for joining us. Be sure to watch all of our videos on fruits and veggies. Bye guys. Ontario Greenhouses grows so many different types of tomatoes, from cluster tomatoes to beef steak, grape, and tomato. Not to mention the traditional heirloom tomatoes.


Good morning, John. It's been almost two years since our last big election here in the US. In the Montana during that election, a weird thing happened. While Donald Trump was winning 70% of the vote, we had a governor who got reelected with 54% of the vote who was a Democrat. And that just seems a little bit like something that I don't understand and that I would like explain to me. I have got, coming into my office today, an expert on this topic. I think probably one of the preeminent experts on this topic. Governor Steve Bullock, why are you in my office? You're getting my script. Stop reading my script. I can't read the script. Where do you look? Right here or here? Yeah, I mean, people won't be able to tell the difference. It's Governor Steve Bullock, the governor of my state. Hello. How do you like my office? If all of America in the world could see it all. They can. They can only see this before. He recently made some headlines when the FCC was spoopooing on net neutrality. And this is a big deal in my line of work. And Montana, I was sort of surprised, was the first state to come up and say, well, no, let's have a use on an executive order saying, let's have some protections, at least here in the state of Montana, to maintain that neutrality. Why? And how does that work? What we did is said, if you're going to sell internet services to the state of Montana, you not only have to have a free and open internet for Montana, but for all Montana. You're not saying that they can't do it? They can block and throttle all they want. But that just means they can't sell services to the state of Montana. Or now, the state of New York, New Jersey, Hawaii, Vermont, as other governors have done the same thing. Did they base that legislation off of what you wrote? They basically took our same executive order. And we even provided for any governor, you can just click and fill in a template to do so. How this came about, though, was pretty interesting. Well, my staff came out and said, your daughter is calling through your main switchboard. And I'm like, why would Caroline call my main switchboard? So I pick it up. And she had called our congressional representatives voicing her concern and some of her friends about repealing net neutrality. And my first answer was, I'm sorry, honey, I can't do anything. This is a federal issue. But that got me thinking, no, actually, the states could take the lead on this when the administration is trying to roll it back. You can thank Caroline for saving the internet. Thanks, Caroline. I've written in my notes here, Montana Red State. You governor, how? That's what my notes say. So you know what I mean. I'm legitimately very curious about this from several angles. Like, one, I believe in pushing good progressive agendas and having you in charge of the state of Montana really helps with that. And functionally helps a lot of people. Second, I think that we have a problem with division in this country and it's getting much worse. And I hope that you can provide me with some hope. First of all, how I got there and how I govern isn't all that different. Those are kind of the same thing to you. Meaning that I show up. I listen. I engage with people. I don't just try to find people that share all of my same thoughts. Well, you don't have that luxury. You can't quite do that in Montana, can you? What do you want? You want a safe community. You want clean air and clean water. Good job. Roof over your head. So those are actually the values that most people have. That's what we ought to be talking about from a public policy standpoint. We actually have to talk to people. Showing up matters a lot. Would it be better for all of us if we were trying to win everyone instead of just trying to mobilize the base? Yes. Yes. Well, you're never going to win everyone. Of course, you're never going to. But try, but make your case. Instead of just abandoning whole sections of the electorate, say like, I am out here for you. Nationally, I think that's exactly what we need to do. We need to listen and we need to persuade. The idea of winning isn't about micro-targeting, finding this group or this person that fundamentally agrees with everything and drag them to the polls. The idea is actually to engage in that public sphere and say, here is why I will be fighting for you. 20% of people who voted for you also voted for Donald Trump. Is that seem impossible to you? Not at all. Not at all, because I think in this highly polarized system, yet too many people say, oh, what's wrong with those voters as opposed to what's wrong with us or candidates if we're not actually speaking to those voters. And I know that 20% that also voted for Donald Trump, they may not agree with me on everything. Well, my wife or my children don't agree with me on everything. But I think they fundamentally believe that I would be fighting for them. I'd be listening to them. I worry a lot about the erosion of faith in press and in government. And I think a lot of people that run for office are running against government, saying government is so horrible. Look, there are inefficiencies. There are ways to make it better, but you ought to be running to be part of the solution. And I don't disagree. I mean, the deli legitimization, if that's even a word. If it's not, it ought to be. I think deligitimization is a word, but I think the thing you said it's not. The tearing down of the media. A hashtag fake news for anything that he might disagree with. I mean, that's not the way we run a representative democracy. So you've run for office a couple of times, a few times. I have. It looks from the outside terrible to traveling on the time you're away from your family, but also you can drag through the mud. Everything is public. Does it suck? This isn't the time to launch Hank Green for governor, based on the way that you phrase that. So the best advice I ever got was actually from a Republican. He was a guy named Tom Rage. He said, you run to win, but you win to run. So you run for office to win, but you win to run government. I know that we have kids in publicly funded preschools now because of our work or health care. Now understand the fact that, yeah, it's horrible. And you're focused on what you can do. It makes some of the challenging parts a little bit less challenging. Sounds like a kind of unique job that maybe you don't really know how to do when you show up first. Like, is there a training course or like a private discord channel just for governors to talk about governor stuff? No, this is just between you and I. Who do you call when you're like, I don't actually know 100% how to governor right now. Yeah, your peer group is small. When you first get elected, there's something called, well, I call it baby governor school. They send you down and maybe how to stand like a governor or talk like a governor. Who's they? Who's doing this? National Governor Association. Okay. There's a National Governors Association. I was right. And I'm about to become the head, the chairman of the National Governor Association come this summer.  About six years. I got elected to be in charge of it all. So learn some from my peers. And then what you try to do is surround yourself with really good people. Listen hopefully as much as you talk. You start out just drinking from fire hose. And it's not without a challenge. I'm very interested in having more young people interested in running for office and being part of government. What would you say to people who might not have considered that? Or maybe you're thinking about it and like advice. I mean, there is no magic age to get involved. First of all, like we have a state legislator in Montana that hadn't graduated high school when he got elected. There are so many things that you can do growing up. But I know that I impact people's lives. Be willing to take that step. You may fail. But I've learned more from my setbacks probably than my success.  We need to have a gun discussion in this country. Can you give some insight into how to like bring people into that conversation rather than just sort of the institutions that are trying to control people's perspectives? You know, I talked earlier about sort of how we share values. There was this group, Pew, that did this big research project just last year and said that two-thirds of the gun owners, one of the main reasons why they own it, is to keep themselves or their family or their community safe. And they don't trust the government's ability to do it. Most folks that want some restrictions, they want to keep themselves and their community, their family safe. They don't trust the government's ability to do it with all these firearms out there. So I think that there's more commonality than we would think. Now we're not going to solve all gun violence, but a public health approach right with cars is, we put in seatbelts, I didn't quite get there, we put in airbags, didn't quite get there, but we continue to approve. Like we know that if we did universal background checks, we know that it could make a meaningful difference. There's red flag laws, the idea that family member of law enforcement sees somebody at a point where there could be a danger. The ability to go petition according to take their gun for a period of time. We know that there are things that can be done. You know, you'd asked earlier about young people getting involved. Parkland, Florida, students may actually fundamentally change. And when we saw in Montana, students walking out, just in recognition and protest. So maybe this will finally be the time where the grown-ups are listening to the kids. What are you most afraid of, like in terms of, not in terms of like your own personal existential dread? The United States has always been the place that everyone looks to as the beacon of hope, the beacon of opportunity. In some respects, we are abdicating our role as the international leader. And I can say that from everything from climate to coalitions where we're trying to do peacekeeping. I worry, as you had mentioned too, about the divisiveness in the system. And look, everybody's life isn't consumed with what happens in government. But if government isn't working, it can negatively impact everybody's life. What are you most worried about? Um, hey, I'm not, you're not supposed to ask questions. This is a remarkable, like, that I got to talk to you. And that you got to see my family. Thank you so much for coming by. I know that you're, I imagine, super busy. That was very cool. It was my pleasure for sure. So really appreciate it. That was fun. Yeah. If you want to watch more of my interview with Governor Bullock, where we talk more about what it's like to be governor, voting, and what we're afraid of, stuff like that. I've taken some of the bits that I took out of this, and put it up on Hank's channel. This was a fascinating and cool thing to be able to do. As the governor was leaving, he said a thing that I've been thinking about ever since. He said that if you win by writing off everybody who disagrees with you and only pulling the people who really deeply agree with you to the polls, then maybe you win the election, but also maybe you lose the ability to govern. We might be seeing what that looks like right now. But if government stops working, yes, that hurts everybody, but it especially hurts the people who need help the most. John, educational videos are exempt from time limits, and I will see you on Tuesday.   So did you already snap me, or should I say hi or something? Oh yeah, why don't you say it? Hello. Their names are Carolina and Alex. Hello Carolina and Alex. This is weird. But we passed one of the most progressive campaign disclosure laws. Oh, she just scored.  Travis. Travis! Should I just start swearing a lot if we want to come back? Yeah. Well, what you want to do, you have to be relatable to the youths. So if you could just like, I don't know, say lit.


What's up everyone? It's your girl Kenzie here from Layton Sports Cards and I'm ripping 2022 Panini National Treasures Baseball Hobby 4 box full case break number 20. Pick your team. I'm going to go over the teams here and we will get started. Alex C has the Guardians and Yankees, Bob K, A's, Brian H Giants, Chun Wei W Angels, Guy H with the Braves and Dodgers, James P Raze, Jason F Rangers, Jeremy H Mariners, Jonathan Q Red Sox, Joseph D Pirates, Justin H Cardinals, Kevin C Metz, Mark S Marlins, good luck Mark, Marshall D with the Rockies, Matt M Twins, Matthew B with the D-Backs and Astros, Max K Reds and Blue Jays, Nester R Nationals, Noah H Cubs, Ryan N Orioles, Ryan B Phillies, Sean M Royals, Taylor W Padres and Burrers, Thomas S Tigers and teaming C with the White Sox. Alright, best of luck everyone. Thanks for the fill. Here we go. Again, just one team left in the next break and it is the Rangers on say they are 69 bucks. Alright, here we go. N.T. Baseball time. It is. It is and is. Alright, here we go. Let me real quick pull up the checklist here because I know there's some old school players. I just want to be certain for good luck. Crazy cut-off on this this year too. Assuming. Yeah. Crazy booklets. I know for like N.T. Baseball a lot of like the old school booklets of like our old school players were like a like checks old checks and stuff. Yeah, that's usually what that's like because back then that's like pretty much all they used to pay with. It's not really on the bottom. We have retro materials of Taiwan Walker. That is 33 out of 99. Mets. No, unfortunately. Randy Rosarana, 88 out of 99. The Rays. We have a Hall of Fame materials, Luke Applin, Chicago, 38 out of 99. I like how they did these. These are cool. These ones. Yeah, you've got blue jays. Anthony K. That's seven out of 25. Anthony K. Did he? Let's go off to check that out, Mark. We've got Padres, 54 out of 99 Kevin cops on the die cut materials signatures. Padres. Nice one here. Going back to the Padres, James Wood on the definitive ink, 72 of 99. Does that mean that one soda was a national image? We've got a nice patch here. Chas McCormick on the patch auto, 53 of 99 for the Stroh's RPA there. Chas McCormick. Nice one here. Toronto. Have a little boba shed action. 48 out of 49. There you go blue jays. Mr. Hare. He's got a nice auto too. What do we have here? We've got booklets, 14 of 99 dual signature materials. Wow. Gavin Sheets and Jake Burger. You got White Sox, both on card too. Gavin Sheets and Jake Burger. Sheets and Burger. And we've got 29 of 51 little Ichiro action on the treasure Jersey numbers. Such a beautiful card. Nice one there. Those come one for kids. Yeah. Usually those like inserts. 29 of 51. That's really cool. I was thinking that was an auto. I didn't realize that was an auto. I figured so. I was like man, Ichiro auto. All right. Very solid first box there. We've got Colossal Patch of Young Diaz, 99 of 99 book in. Rees. Thanks Brandon. Appreciate it. We've got Greg Geekman of 50 of 99 for the Cubs. Yeah. She's doing awesome. Growing so fast. It's crazy how fast they grow. We've got Field Gear, 75 of 99 Dennis Eckersley. Eckersley on the Field Gear. We've got Rookie Signatures, 92 of 99 for the Reds. Nick Sanzel. Sanzel, right? Sanzel. 92 of 99. We've got Rookie Auto, 4 of 99 Andre Jackson. Dodgers. I don't know if that's for sure. It really does. Cool one. Here we've got Bat Relic and Auto Tim Hudson for the Braves. 19 of 49. Tim Hudson. He gained more news material on the Bat Relic. Yeah, that is from 2019 NT. Wow. Dude, I was literally thinking that. I didn't think that was working. Yeah, I was like wait a second. Yeah, that's from 2019. We've got another RPA here for the Astros. This time, Jose Ciri. 55 of 99. Astros doing well. Back to back boxes with RPAs. 2 and 4. Oh, wow. And nice one here. Going to the Pirates. Patch Auto, O'Neill Cruz. 38 of 49. Rico Pittsburgh. That is Joseph D. Very nice. On the die cut material signatures. Are the Pirates your baseball team? I say yeah, just because I'm a Pittsburgh fan, but I really don't watch too much baseball. And then we've got Cool Patch here. Patch Auto, Matthew Nelson for the Reds. 6 of 49. Is there damage on it? Yeah, across his chest. Yeah, I do see that now. Yeah, it looks like there's like an indent. It almost looked like it was from the card. Part of his jersey, right? Yeah, part of the card. But there's like an imprint on there. We will send a box here with the Pirates. Man, hopefully you can get that one replaced because that's a pretty big card. Matthew Nelson, 6 out of 49. We're still going to mag that one. And Hall of Fame Materials, 25 of 49. How about Rod Carew? That's cool. Here you go, Twins. Here you go, Minnesota. Very nice. All right, box 3. We see if just the Twins are left or Rangers, I believe. Nope, we are sold out for the next one. All right, so we got to get these Spectra half case four boxers going. Again, that just released yesterday. Looking for the gold vinyls on it there. Let's see who we have left. Cardinals, Panthers, Browns, Cold Stolphins, and Bucks. 5 to go. Digi Camo Patch? That is so cool. Yeah. We've got Adam Frazier, 10 of 10 on the bookend patch there. Two color. Mariners. The Red Tech Camo. Sean Murphy on the Colossal Patch for 8. We've got Bat Relic on the Hall of Fame Materials of Jim Bottomley, 22 of 25. You ever seen the 18 family? Yeah, a magic fan. Oh, yeah. We've got going back to the Twins, 50 of 99. Trevor Larnick. Here we go, Minnesota starting to heat up here. Dual Patch Auto going to Boston, 13 to 25. Alex Benelis. Red Sox on the Dual Patch. We've got Colossal Patch Auto. Alex Manoa. 97 of 99. Wow, look at this patch. My goodness. We've got RPA, Hunter Green, 13 of 25 for the Reds. Partial Logo Patch there. That's nasty. That is nasty. 13 of 25. Let me just make sure. That's a crazy book to patch, too. Yeah, it is. All right. We've got one-on-one Frinting Plate Patch Auto of Jeff McNeil for the Metz. Another partial logo patch. That's really cool. Grats on that one, Metz. New York. Kevin C. Congrats on that one. We'll mag this one for you. What's up, Yogi? How you doing? Hey, boo boo. And we've got Legendary Signature City, 7 out of 25. 7 of 25. Wow, look at that. Wow. And the man. What? Wow. Oh my God. I was not expecting that one. Holy cow. That's crazy. 25, I believe? 7 of 25. Who had them? Who had the Cardinals? My goodness. Justin H. Wow. Congrats on that one. I don't want to take a picture, so I won't put it up yet. And last one here. We've got Christian Bethancourt for the A. 65 out of 99 on the Legendary Signatures. Yeah, that's sick. Stand the man. All right, last box here. Yeah, we're running the same break back up next. It is already sold out. We're going to fill up the Spectra Football next. That is. I was like, wait a second. How do they get his signature like that? I don't know. It looks like it's like some kind of reflective sticker or something. All right, we've got Colossal Patch Three Colors. Nice one here. Tyrone Taylor. 21 of 25. Brewer's. Nice. We've got a partial laundry tag here. 2 out of 8. Cabrion Hayes for the Pirates. Here you go, Pittsburgh. Here's a legend. How about Duke Snyder? 5 of 7. Snyder. That's my dad's favorite player. Game worn, used material. Well, Brooklyn. That's Dodgers, correct? Yeah. Nice sit there for the Dodgers. That's really cool. And we've got Legacy Signatures. Austin Meadows as White would say Detroit Legend. Any Detroit player you pull who says Detroit Legend. There you go, Tigers. This is cool. We've got AJ Alexi. Hashtag straight up Texas. That's cool. 54 out of 99. There you go, Rangers. One of the last teams taken. Yeah, Andy. That's awesome. We've got Colossal Patch Auto. Logan Gilbert. 6 or sorry, 9 out of 49.  Yes, ma'am. Logan Gilbert. We've got RPA here with a nice patch. Andre Jackson for the Dodgers. 80 out of 99. Thank you. Andre Jackson. And we've got Patch Auto. 6 out of 18. Trevor Story for the Rockies. Nice story. I like that almost every card is like on card too. Yeah. Majority of them. And Rookie Signature Jumbo Material 2 of 99. Mike Bauman. Going to Baltimore. You go Orioles. Mike Bauman. 2 out of 99. We'll do a quick recap here. Start with the Relics. Relics. Cabrion Hayes. Pirates. Adam Frazier. Marius. Sean Murphy for the Aes. We had Jim Bottomley for the Cardinals. Dennis Eckersley Aes. Greg Deepman Cubs. Yandy Diaz. Raze. Luke Apling Cubs. Randy Rosarina. Raze. We had Tyrone Walker for the Yankees. Or the Mets are. As well as the Tyrone Taylor for the Brewers. We had Trevor Story Rockies. Christian Bethancourt Aes. AJ Alexey Rangers. Logan Gilbert for the Mariners. Andre Jackson Dodgers. Hunter Green with the Nasty Facts there for the Reds. Trevor Larnock. Twins. Alex Benales. Red Sox. Alec Minoa for the Blue Jeans. Matthew Nelson Reds. The second half here. We had Austin Meadows. Tigers. Jose Ciri Astros. Tim Hudson Braves. Andre Jackson Dodgers. Nixon Zell. This is from 2019 and T. Pretty cool one there for the Reds. Blue Jays. Chesman Cormac Astros. James Wood Padres. Kevin Cops Padres. Anthony K. Blue Jays. Bucks. Ricky Jumbo Material. Mike Baumann for the Orioles. We had the Rod Karoo Patch for the Twins. The Dual Signature that was Jake Berger and Gavin Sheets for the White Sox. And we had two Mag Cards. We had the one-on-one printing plate patch auto of Jeff McNeil. Jeff McGill. Sorry for the mess. Thanks for one printing plate there. And then the O'Neill cruise on the patch auto 38-49. The card was a bit damaged there as you can see going through his jersey. We will be sending a box here for the Pirates. And then talk about a booklet. This is just absolutely bananas. Seven of 25. Mr. Stan the Man himself. That picture is so cool. That's just crazy. There you go. Cardinals on that one. Seven out of 25. Congrats everyone on those hits. We've got another case coming right up.


So, we will start with the next couple of lectures. So what we are going to do is we are going to analyze selection sort that we had studied last time. So, here is a quick animation of selection sort just to recap what exactly happens. So, this is an array of 6 integers and we want to sort it in decreasing order. So what we are going to do is we will first find out the maximum element that is 27 and we will swap it with the element at the top of the array. Then in the remainder of the array, we will find out the maximum element which happens to be 25 and then we will sort it with we will swap it with the next position in the array, then 24 swapped with the next position in the array, then there is another 24 which gets swapped with the next position and finally, there is 18 and 17 which are already in the right positions. So, that is selection sort and finally, at the end of it you have the entire array sorted in decreasing order and just to recap this is how the selection sort function in C plus plus looks like. So, there is this loop in which current top is gradually changed from 0, 1, 2 all the way up to n minus 1 and the part of the array between current top and n minus 1 is considered the unsorted array. So, in every iteration of the loop you find the index of the maximum element in that unsorted part of the array and then swap it with current top and what does find index of max do? It really iterates from the start index up to the end index and if it finds an element which is greater than equal to the current max index, it just registers that and swap is of course, very standard. So, everybody is up to speed with this right. So, now what we want to do is we want to count the number of basic steps involved in selection sort. So, what is a basic step how do we define what a basic step is? So, you can roughly think of that the time the total number of steps and hence the total time taken for sorting an array should have some dependence on the number of elements in the array. The time it takes to sort an array of size 2 should certainly not be the same as the time it takes to sort an array of size 2 million. So, there has to be some dependence on the size of the array and that is what we are trying to analyze over here that how much time or how many steps does selection sort take to sort an array of size n, but of course you know in the selection sort function as we saw there are several things happening we are reading elements of arrays comparing them updating some other stuff and all of that. So, what we are going to do is we are going to group together operations which the time taken for which is independent of the size of the array and it is some kind of constant. So, for example, to read two elements of an array a to compare them and to update the other variable current max index this might take 20 nanosecond on some computer or 50 nanosecond on some other computer or maybe 1 millisecond on third computer. But this is independent of the size of the array no matter whether the size of the array is 1 million or 1 billion the time taken to do these operations is going to be fixed for that computer it may vary from computer to computer it may be different from what it is going to be today from what it is going to be you know 5 years down the line it may become even faster, but nevertheless this is some time that is taken for performing some computational steps and the time taken for this is some constant that depends on the technology that we are using for our computer today and it is independent of the size of the array is that clear that is what we call a basic step it is a step for which we know that there is a certain unit of time that is required maybe 20 nanosecond maybe 50 nanosecond whatever, but it is independent of the size of the array and this unit can keep changing as computers become faster as we have more advanced technology, but nevertheless this is one unit that is independent of the size of the array fine. Similarly to swap to specified elements of an array this time does not depend on how large the array is it just depends on how fast your computer is running right. So this is so these are things that we are going to consider as basic steps and you know I mean maybe incrementing i whatever checking whether i is less than n all of those things you can bunch in inside these they are also as long as I say that I am considering the time taken for one comparison of i to n or for one increment of i it is independent of the size of the array it is independent of the size of the problem is that clear so that is what we mean by a basic step it is a certain abstract notion, but a basic step means to do a computation it takes to do that computation involved in a basic step it takes some fixed amount of time and that is independent of the size of the problem the input problem ok. So we are going to count how many such basic steps that needed in selection sort and in particular we want to count what is this number of basic steps as a function of n ok. So let us see how this might work so here is our array of size 6 so n is 6 initially current top is there at 0 and then we want to find the index of the maximum element in the part of the array between a 0 and a 5 right. So that is the call find max find index of max array a starting position 0 total 6 elements and what is going to happen when we execute this function find index of max we will start off with current max index start i everything over here at 0 and then we take one step wherein we increment i and check whether 18 is greater than 24 18 is not greater than 24 so current max index stays there we take the second step is 17 greater than 24 no so current max index stays wherever it was 25 was indeed greater than 24 so current max index gets incremented and then 27 is greater than 25 so current max index increments again and finally 24 is not greater than 27 so current max index stays there and i increments there. So how many steps did we take so starting from here this was one step two steps three steps four steps five steps and in each step what did we do we read some element of an array compare it with some other element incremented something updated something basically a fixed amount of time in each of these steps and there are five such steps that we have to take right. So we used up five basic steps and in general you can see that if this array is of size n then we I mean here the array was of size 6 so we took five basic steps with the arrays of size n we will start from the 0th element and we will have n minus 1 subsequent steps right so in general n minus 1 and after that what do we do we have to swap this fourth element which we found out to be the maximum with current top right and that swap also involves reading an element of the array copying it somewhere writing some element of the array so it is some fixed number of computational steps takes a fixed amount of time so we will count that as one basic step so totally we have used n minus 1 plus 1 basic steps so far right this is one iteration of the selection sort loop when current top was 0 what is going to happen after that so basically we have just finished one iteration of this loop what is going to happen after that current top will become 1 and will iterate again so when current top becomes 1 we are here and what does the next iteration do it basically calls find index of max in the array starting from position 1 and what is going to happen there we will start current max index and i and everything over here and then we are going to increment i and 17 is not greater than 18 so current max index stays there will increment i since 25 was greater than 18 current max index gets incremented does not get incremented and does not get incremented because 25 was less than 24 in both cases so current max index stays there once again how many steps did we take starting from here so this was 1 2 3 4 so we now have 4 basic steps and if you generalize it to n elements if there were n elements in the array and we are already done with the first element so current top is at 1 now so it is easy to see that we are now left with n minus 2 steps right so n minus 2 steps and then of course we have to swap so that swap itself is going to be considered as 1 basic step and so what are we left with n minus 2 plus 1 basic steps okay now after that when current top reaches the second index right so here it was n minus 1 plus 1 here it was n minus 2 plus 1 so now it is so n minus 3 plus 1 basic steps at the next position and finally when I reach the n minus 1th entry there would have been n minus n minus 1 plus 1 basic steps so this is fairly straightforward to see so what is the total number of basic steps that we used so you add up all of those expressions n minus 1 plus 1 plus n minus 2 plus 1 and so on and if you do some simple algebra it turns out to be n minus 1 times n plus 2 by 2 the important point is that this expression has a quadratic dependence on n there is an n squared in it right so this increases quadratically with n and what do we mean by that so here I have just tried to plot how n minus 1 times n plus 2 by 2 looks like for values of n from 10 to 100 and you can clearly see the outline of a parabola over here right because this is a quadratic function right so is that good enough I mean is the number of steps that we are seeing that to sort an array of size 100 we will need some 5049 steps and then it is going to increase quadratically is that good enough it turns out that it is actually pretty bad and so this can indeed be I mean if if each step takes whatever 50 nanoseconds and if the number of steps is going to grow quadratically then the total amount of time that you need is also going to grow quadratically right and that is not good news because it basically means that we cannot use selection sort for sorting very large arrays and here is a simple illustration so suppose I have 1 million data items each with a score and by the way 1 million data items is actually a very small number in today's world if you do Google search with you know any reasonable thing let's say you know independence day of India or something you'll come up with around 10 million pages so 1 million is really a small number in today's world and if I have 1 million data items each with a score and if I want to sort these data items with respect to that score how many basic steps are required so if n is a million then n minus 1 times n plus 2 over 2 is roughly 5 times 10 raised to 11 and if each basic step takes 20 nanoseconds so this is really almost at the edge of today's technology if you want to do two array reads from memory compare them and write back one something else back to memory I think this is the fastest computers available today will probably be able to do it in around 20 nanoseconds so the computers that you are running we are running in the lab which will take much more time than this but even if I take that that if you if each basic step takes 20 nanoseconds and then if you multiply it by this number you find that you need approximately 2.78 hours to sort an array of size 1 million which is not large by today's standards so clearly this is not going to be very useful for sorting large arrays if I take hours to sort I mean it's it's like you know 2.78 hours is a movie almost so you hit the enter button on your computer go see a movie and come back and then it says it's still crunching it's not yet sorted it right so that's not good enough can we do better fortunately we can do much better and in fact what we will study in the next few lectures is that it can be done in rough roughly n times log n base 2 basic steps as opposed to n squared some function of some function like n squared force in selection sort you can actually do it in n times log n base 2 basic steps and now if you figure out how much time it would take to sort that same array of size 10 raised to 6 we'll find that in a few seconds can be done so therefore what is important is that sorting is a real world problem we'll have to solve this problem we found out one method to do it which was selection sort and it was working fine it was indeed sorting and it was doing something nicely we could program a computer to do it but it turns out that it is not good enough it's not fast enough its performance is not up to our expectations and so we'll have to now learn about other ways to solve the same problem to sort an array of numbers but I mean these other ways should do something cleverer should do something smarter such that the number of basic steps required can come down significantly so that we can then actually use it for doing real world for sorting real world data okay so is that fine is there in doubt about this so in the next part what we're going to do is we're going to study another way of sorting this the same array of integers and we'll see that this sort this way of sorting which is also called merge sort works very very differently from selection sort I mean there are some similarities but by and large it's very different and in the next class we'll actually do an analysis of merge sort and we'll see that it actually achieves that n times log n base 2 probably with some constant multipliers 2 times n times log n base 2 or something but roughly that so so this is essentially saying now you have learned programming now you have learned how to solve a particular problem but we are not happy with that solution it's not that we cannot program or computer to solve that problem we can program or computer to do selection sort but we're not happy with that solution it's not solving real world problems so let's do something smarter and then of course we want to program it on this also onto computer okay so what was the intuition behind selection sort given a particular problem let's say to sort an array of size 6 we solved part of the problem basically we solved the problem for just a one element thing we said okay let me find out what should be the top most element here okay and then we were left with the remaining five elements and we said that that's a similar but simpler problem to solve similar because it's still sorting simpler because now I have n minus one elements five elements to solve so if you see the basic principle underlying this what we are saying is we want to go from a bigger problem to a smaller problem and by solving the smaller problem and combining it with something else that I've already done I want to get a solution of the bigger problem okay so this is a general paradigm in computing where you know the I mean this is kind of this repeats in several I mean those of you who are going to study computational techniques further you see that this theme repeats several times it's it's one of the very well known techniques for solving difficult problems so what you do is you take a large problem a complex problem and you break it up into small parts okay but of course you've got to break it up into small parts in the right way such that if I give you the solutions of these small parts you can combine those solutions back to get a solution of the bigger problem so it's too difficult to solve a big problem let's break it up into small parts if that is too difficult let's break those up into smaller parts if that is also too difficult let's break them up even into smaller parts until we find that the problem is small enough simple enough that we can solve it and let's solve the simple problems and let's combine the solutions of the simple problems together to get the solution of the original problem so that's the overall idea is also called divide and conquer and I'm sure all of you know that the British basically used this to rule India for a very long time so we are going to use this to conquer difficult problems so how do we sort using divide and conquer right so always keep at the back of your mind big problem we don't know what to do let's break it up create some smaller problems out of it so we'll just break it up and create two smaller problems out of it and how did we break it up by just putting a line over here by just breaking off that array over here so 24, 18, 17 goes to the top sub array 25, 17, 27, 24 goes to the bottom sub array and we've basically broken it up into two parts now these two parts are themselves similar but simpler problems right I still have to sort those two parts so they're similar but they're simpler because they just have half the elements compared to the previous problem and how are we going to sort them so let's not worry about how we're going to sort them individually now let's say by some means maybe by selection sort or by manually inspecting it I have been able to sort the top sub array turns out that this was already sorted so not much needed to be done and let's say I have also been able to sort this bottom sub array over here by some means after I have sorted these this is a sorted array of size 3 that's a sorted array of size 3 but I really wanted to get a sorted array of size 6 so how do I take these two sorted smaller arrays and somehow get this larger sorted array out of it so clearly if I put this array after this it's not going to work because 17 will appear before 27 in this particular case if you put this array on top of that array it will work but in general it need not work because this array will have some of the elements this array will have some other elements they are individually sorted but when you put them together they may need to get interleaved right and this is one sorted array this is one sorted array but only when you interleave them maybe you'll get the overall sorted array so that's what we're going to do we're going to take these two sorted sub arrays and we're going to merge them you will see how to do this merge but we're going to merge them to create the overall sorted array and that's what is going to be our basic idea that will divide the problem then we'll somehow sort the smaller sub problems and then we'll merge the solutions of the smaller sub problems to get the solution of the larger is that clear three basic steps or three you know key steps over here so the first step is to divide an array of size n into two arrays of size n by 2 how difficult is that this is actually extremely easy just calculate the index of that middle element and 0 to that middle index is the first sub array that middle index to the index is the last sub array and of course if that array is not exactly if n is not even then you'll have one more element in one half than the other half so let's let's not worry about that and then we have to sort each of these sub arrays of size n by 2 how are we going to do that should we apply selection sort or should we do something else let's postpone that for the time being what we're going to now focus on is to see how we can merge these two sorted sub arrays each of size n by 2 into one bigger sorted array of size n so that's our objective we want to see how we can merge two sorted sub arrays so the important point is the two sub arrays that we are trying to merge are already sorted so we should make use of that we should exploit that and we should then try to merge them into one larger sorted array so here is sorted sub array 1 here is sorted sub array 2 and okay so how are we going to merge these two sorted sub arrays so remember that this is sorted already in decreasing order and the other guys also sorted in decreasing order which means that this is the maximum element of this sub array and this is the maximum element of this sub array right so this is the maximum element of one sub array and that's the maximum element of the other sub array then the maximum of those two elements should be the maximum element of the entire array right so that's what we're going to do we are going to compare these two elements and figure out which is maximum and that should be the maximum element of the entire array so since 27 is greater than 24 so 27 moves to the maximum position for the maximum element and of course now that we have taken care of this element we can reduce our whatever index or arrow to the next element so now we are looking at this sub array 25 24 which is already sorted in decreasing order and we are looking at this sub array which is also sorted in decreasing order so once again if this is the maximum element of this sorted array and this is the maximum element of this this part of the sorted array then if I just take the maximum of these two I should find the next element right so that's what we're going to do 25 is greater than 24 so 25 comes there and then that index increments there and then finally we check whether 24 both of them are 24 so it's not that one of them is greater than the other so let us take the top one with the top array has been waiting for a long time so let's take one from there and so the index there comes down right and after that it's the same thing we have to check which which is greater than what 24 is greater than 18 so we pick up 24 put it there and now we are done with the second sub array we have put all the elements of the second sub array in the rightful place and note that there is a 27 25 and 24 there is one element of the first sub array has gotten inserted in between right and now of course since we have only one sub array remaining and their elements are already elements are already sorted in freezing order we can just put those elements here and that gives us the overall merged sorted array is that clear so I hope you noticed how this arrow came only down for each of the sub arrays it did not ever move up it only came down it only kept moving down I was either moving down once the arrow for one sub array or the arrow for the other sub array at no point of time did I have to go back and retrace what I did earlier right so therefore that's how we're going to merge two sorted sub arrays of size n by 2 we're going to make one pass over each one of them and put the elements in the right order well so we had postponed this problem how do we sort each sub array of size n by 2 so now should we use selection sort or should we use some other thing so here we can step back and just think about what we're originally trying to do we were originally trying to sort an array of size n and now I'm required to sort an array of size n by 2 so it's really a very similar problem and so can't we use the same steps that we used to solve the original problem which basically means take this array of size n by 2 break it into two parts somehow sort those two parts and merge what is that somehow sort those two parts take that and again break it into two parts and keep doing this right so this basically suggests I'm going to use the same technique to solve a simpler version of the problem and what is the termination case case of that recursion so of course when there is a size 1 then everything is sorted so I don't need to break it up further so here is how it's going to work divide and conquer in action for sorting our array so we'll first break it up into two similar but simpler problems by just cutting this array at the midpoint okay now how do I sort this array this is too difficult a problem for me so I'll break it up further and because it had three elements so when I break it up one of them will have one more element than the other and now I've got to sort these subarrays how do I sort that subarray since that has just one element that's easy I know it's already sorted how do I sort the other subarray it's too difficult it has two elements I know how to sort sort arrays of only size one so I'll break it up for this two arrays of size one and then I know how to sort arrays of size one they're already sorted nothing to be done and then I'm going to merge them back right so when you merge those two back you get this so now you have this sorted subarray this was sorted because it was trivially sorted because of size one and this sorted subarray and now we've got to merge them back into a sorted subarray over here and then we've also got to solve the problem for this but once again this is too difficult let's break it up into smaller parts and then one of these smaller parts I know how to solve so that's done the other smaller part is again difficult so break it up into even further smaller parts and then I know how to solve each of those cases and then I just merge them back to get this and then I merge those back to get this and finally emerge these two back to get this and that is the sorted array and this entire process of going from the unsorted array on the left to the sorted array on the right by repeatedly breaking it up into two parts until we reach the case where we were left with an array of size just one and then we said that we know how to sort that array and then we just merged everything back so this process is called merge sort and it's kind of obvious why it is called merge sort the key step here is actually merging the other step is just breaking it up breaking it up breaking it up until we reach arrays of size one right so the key step here is really merging so this called merge sort so are there any doubts on this part of the lecture no okay good they're dividing into three parts there are no three parts right every problem is yeah so you merge them and you get this is now one sorted array one sorted sub array this is the other sorted sub array so once again you have two sorted sub arrays and you want to merge them yeah so once we merge them we get one sorted bigger array but now this bigger array happens to be a sub array of the original thing so now this this is one sorted sub array that is another sorted sub array and then we merge it back so at every step I'm saying that there's a more difficult problem let me break it up into smaller problems once you solve the smaller problems I'll just combine them to get my solution but how do I solve the smaller problem again break it up okay fine so all of you have the answer sheets okay good so let's start the quiz okay so this is the first question the number of basic steps to sort an array of n elements by selection sort grows quadratically within linearly within logarithmically within exponentially within which of the following is or are not true about merge sort can be implemented as a recursive function it's an example of computing by divide and conquer it proceeds by finding an extreme element and sorting the remainder of the array and it does not use any comparisons so which is or are not true go to the next one in merge sort the merging of two sub arrays happens before sorting either of the sub arrays after sorting both the sub arrays after sorting one but before sorting the other sub array so which of the following cannot be considered a basic step when analyzing the performance of selection sort swapping two array elements comparing one array element with another reading an element of an array finding the index of the maximum element which cannot be considered a basic step the last question will sorting an array of size n by recursive merge sort the termination case occurs when the size of that is even size of that is odd size of that is 1 size of that is exactly n by 2 okay so now you should turn in your answer sheets to the TS please collect the answer sheets and bring them here okay so now what we're going to do is we are going to try to solve some practice problems so here is our practice question we have seen part of this question in the last class we want to follow up on that remember in the last class I had actually drawn it out by hand but here I've tried to put it slightly more formally so we have an unsorted array a containing n elements okay and that could be our unsorted array for example and we want to modify selection sort so that we save some computation last time we said we want to save some computation but now that we know what a basic step is let's say that we want to modify selection sort so that we save some basic steps compared to selection sort as studied and at the end of it a should be divided into three sorted segments that the sorted segments could be of any size remember we discussed about this in the last class just before the end of the last class right so so for example given this array input array it is fine if the output of my sorting procedure is this because this array can be divided into three parts so is that each of the parts are sorted in increasing order 039 is sorted in increasing order 1678 is increasing order 22345 is an increasing order however the whole array is not sorted in increasing order 9 appears before 1 and 8 appears before 2 and so on is it clear so if you run selection sort on the entire array then it will just sort everything so we are saying we don't need that it's okay if that modified selection sort keeps things sorted within three segments of the array it basically divides their into three parts and within each part it ensures that everything is sorted this is the question we looked at last time so what we're going to do today is simplify it a little bit and say that okay let's not worry about three it's worry about two parts so we want the modified selection sort to order the elements in the array such that the array can be broken into two parts and in each part it is sorted is the question clear to everybody so now we have already seen that the number of basic steps needed to sort an array of size n by selection sort is something like n-1 times n plus 1 over 2 the question is that how many basic steps are going to be needed if you divide the array into two segments of size m and n minus m so remember the our modified selection sort is required to have two sorted segments of the array the whole array need not be sorted right and we are expecting to get some savings in terms of the total number of basic steps so we are saying that suppose these two segments are of size m and n minus m so how many basic steps would be needed and more interestingly for what value of m is the number of basic steps minimized what should you choose the sizes of the two sub arrays such that the total number of basic steps needed to ensure that these two segments are sorted by selection sort is minimized and I mean you're free to do it using whatever way you want but I mean this is basically a minimization problem right and once you find an expression for the total number of basic steps in terms of m and n you can apply your high school calculus techniques find out for what value of m is it minimized but I want you to do it okay and actually figure out how many number how what should be the size of m and then for those of you who can complete that I would like you to apply the same technique to figure out how to solve the problem with three segments is the problem clear to everybody we are saying that we don't need the whole of selection sort we just need selection sort to break that into two parts is that each of them are sorted so what should be the sizes of these two parts such that the number of basic steps is minimized and similarly if I want to break it into three parts as that each of the three parts are sorted what should be the sizes of three parts first write down your solutions then we'll ask you to discuss with your neighbors and then we'll try to project some of the selected solutions away so I guess you can this you know exchange your copies with your neighbors and discuss how many of you have solved the case for two segments and how many of you got n minus one and one as the answer nobody n by four and train by four as the answer nobody okay and by two okay so okay just swap it with your neighbors and see if and how many of you got the answer for the three segment problem you actually solved it and found the answer not saying I think that this will be something nobody has got you have got solution for three segment you've actually solved it and found the answer okay okay so I've just taken Gautam's copy I'm sure a lot of you would have already done it like this so you just the two the two parts are of size m and n minus m so you just form the expression for the number of basic steps do some simplifications and then you want to find the minimum value of that so you differentiate it with respect to with respect to what m right so and when you differentiate it with respect to m and set it to 0 is it guaranteed to give you the minimum value can also give you the maximum value right so has has anybody I didn't see anybody computed the second derivative and shown that it's really the minimum you have okay I should have okay great so you should do that because otherwise you know the minimum value may be at one of the extremes okay so so this is differentiated set equal to 0 and then it turns out to be n by 2 roughly so for the three segment part you basically do the same thing the three parts are of size ml and n minus m minus l and you form this expression simplify it and then you do what differentiate it with respect to if you take the partial derivatives now this is a function of two variables right so if you take the partial derivatives and then equate the partial derivatives to 0 and did anybody compute the second partial derivative okay you did okay and you can show that that is indeed the minimum okay so that happens at m by 3 so can you give this okay so I hope everybody got m by 2 right once you form the expression you differentiate that's fairly easy the m by 3 part is also n by 3 part is also easy just that the expression becomes a little bit more complicated so now here is the second question you have an array called birthdays and let's say there are thousand students and we want to store the birthdays of thousand students in this array and each birthday is going to be stored like this it's an integer in the year month day format okay now we want to sort the array in order of earliest to latest birthday which means that a birthday on 1st January regardless of the year is earlier than a birthday on 1st February which is earlier than a birthday on 3rd February and so on right basically you can think of this as we want to sort this array in this order so that we know which days we can celebrate birthdays in the class okay so we don't care which year the student was born as long as there is a birthday we can catch the student and say please give us a treat so so for example 1984 6th February should be ordered before 1983 21st March although 1983 happens before 1984 because 6th February happens before 21st March is that clear this 6th February because the day 6 the month is 2 is 21st March because days date is 21 and month is 3 and similarly 1985 22nd March will be after that okay now remember in last class we actually talked about this operator the ordering operator and this is an example of that ordering operator which is neither the less than or equal to up on integers not the greater than equal to on integers right this integer is certainly not less than or equal to this okay this integer is in fact greater than equal to this but then this integer is not greater than equal to this, this in fact less than or equal to this. So, here the ordering operator is neither less than or equal to nor greater than equal to, it is an ordering operation that we have defined which is the ordering of birthdays in a year. Is it clear how we want to order this array? So, in the morning's class actually one student raised his hand and said what happens if you have a birthday on 29th February. So, I said I don't know. So, does anybody here have a birthday on 29th February? No? Does anybody have a friend or a relative whose birthday is on 29th February? Oh, there are lots. So, what do they do? Do they celebrate birthdays once every four years or they celebrate on 28th? So, well, so if you have a birthday which is 29th February, maybe you can I mean from people with experience they are saying there's a celebrate around 28. So, we can consider it the same as 28th February and that's how we want to order them. Or maybe for the time being let's just assume that no student in this class which is true right no student in this class has birthday on 29th February. So, let's assume that we won't deal with that case. So, here is how selection sort for this problem might look like there is a typo here this should have been find index of min, but this function is looking ok. So, find index of min this is the loop that we had remember for selection sort to find the index of I mean in the in the slides we had finding the index of the maximum element in the array. Here we want to really not find the index of the minimum element in the array. Here we want to find the index of the earliest birthday in the array ok. So, we are asking what should you put in over here what should be the expression involving birthday is I and birthday is current min index that should go in there. So, that finally this is the only place where an ordering operator is involved in selection sort remember the other operation is just swapping with current top that does not involve any ordering operation. So, if I can write this part correctly then I can just use the existing code for selection sort and it will already sort my array in the desired order. This is the only place where we use the ordering right and now we are asking what should be the ordering there what should be the expression there involving birthday is I and birthday is current min index ok. So, please this is also not a very difficult question fairly straight forward. So, I want all of you to write it down and then we will have some discussion we will look at the expressions that you write and we will have some discussion on that ok. So, how many of you have solved it hopefully all hands should rise how many of you have solved it ok good. So, I think most of you have. So, this was a fairly straightforward question, but there is something I want to highlight with this. So, this is Ranvijay's solution. So, he says that if birthday is I percent 10,000 is less than birthday's current min index percent 10,000 right. So, why is it percent 10,000 because that will pick up the last 4 digits right which is the month and the day and we are basically sorting with respect to those last 4 digits, but now here is a question. So, how many of you wrote less than and how many of you wrote less than or equal to. So, I mean of course both are correct for purposes of solving the problem, but suppose I write a program which has less than and I write a another program which has less than or equal to I feed the same array to both of them will the result the output of both the programs be the same ok. So, what will be the difference? Those birthdays having the same month and date if you consider all those birthdays which are having the same month and date then the birthday which is the most down the array will be listed first in the sorted array which is considered last in the comparison will be sorted will be listed first in the sorted array whereas, if it is just less than then it will be the opposite case ok. So, does everybody agree with him? So, what he is saying is that if you put less than then. So, I said. So, suppose in the array I have all the birthdays the same just the years are different right. So, if we put just less than then the array will be the same and if you put less than or equal to then it will be reversed. Then it will be reversed ok. So, does everybody agree with him on that? So, what? So, suppose I give you an input array in which I mean this is a very strange kind of class in which everybody has all the 1000 students have the birthday on the same day same day same month ok just that the years are different and possibly different. So, the question is if I put less than birthdays I percent 10000 less than birthdays I percent birthdays whatever current bin index percent 10000 how will that input array get sorted? So, your claim is that it will just get it will stay the same and if I put less than or equal to it will get reversed ok. So, if it is less than it will get it will remain the same how many of you agree with that? Is the question clear? So, in the entire array birthdays all the months and days are the same. So, the only difference is years ok and now we are sorting it using the program selection sort and over here we just saw that one of the solution suggested was birthdays I. So, let us say my array is array birthdays is something like this birthday 0 is whatever you know let us say 1985 1st January and birthdays 1 is 1986 1st January and birthdays 2 is 1984 1st January. So, my array is just like this everything is 1st January, but here the years are different right and the two options that we saw was if birthdays I is less than so, birthdays I percent 10000 this is some current bin index whatever percent 10000. This was one solution and the other one was if birthdays I percent 10000 is less than equal to birthdays. So, in an array like this where all the months and days are the same if I run selection sort with this what is going to happen? Yes same as the input the output will be the same as the input ok. If I use the less than sign on this array and if I use less than or equal to reverse. So, why do you think it will be reversed? So, let us first take a poll from the class. So, what is your name Shrikanth. So, Shrikanth thinks that using less than or equal to this whole array will get reversed how many of you agree with that how many of you disagree with that you ok from here some of you disagree and from here ok. So, let us ask him. Sir, the arrangement will be flipped like, but the whole series will be just reversed I am not very much convinced with that. The whole series will the array will be reversed. I am not very much convinced with that there will be some sort of flipping and all, but like one goes to the n minus 1 when the whole series getting just. So, but will it be flipped I mean Shrikanth claims that it is going to get flipped. No sir I am not. It is just the ulta of what we have now. That is not convincing sir. So, why do you think that is not going to be true? Sir, because at one go one goes to two then two goes to three and three goes to four, but two does not goes to are like. Ok. So, anybody else who said that they do not believe that the array will get reversed? Only the last element comes to the first place and the remaining things gets displaced. Displaced? By one element down. The last one goes up into the array and the remaining ones shift one place. The remaining one shifts one place? No. Oh shifts one place you are saying. Ok. So, why is that? Why does that happen? So, yeah. So, I mean you have worked it out and seen that that is happening. Yes. Ok. So, let us see. So, this element. So, if you use less than or equal to then since all of them are equal the current min index will come all the way till the end right and so it will get swapped with this ok. So, let us say the current min element here was whatever maybe this is let us say 2000 and this is 1999 something right. So, this 2000 will come over here and 1985 will come down fine. So, what we will have is this will become 2000 and this will become 1985. Now, what is going to happen in the next step? In the next step you are going to start from here right and you are going to find the current min index and what will you find the current min index to be it will be this and so now this will go up over here and this will be 1985 and this will be 1986. So, you already see that it is not flipped right because otherwise 99 should have come here right. So, now next what happens you start from here and once again 1986 will be picked and it will come here and this will be 1984 right and then 1984 will get picked and it will get put there and whatever is there will come down right. So, that is exactly what he is saying what is your name? Divakar ok. So, that is what Divakar is saying that everything will get shifted down by one position and only the last element will come to the first and what will be the final last element over here? It will be 1999 right. So, basically the whole thing as if shift cyclically everything comes down and whatever overflows goes back at the top right. So, although it appears that you know the rest than or equal to would actually flip the entire array it is not and this is something that you have to be very careful about because I mean true we may not be interested in I mean for purpose of this question we might say that all of them are the same, but then you might want to sort the same array by different criteria. So, you might say that I first want to sort them by year and then I want to sort them by this and you do not want the previous sorting to be disturbed if two things were equal by the other measure ok. So, but here the less than will actually do that, but now here is a further question I have that if you keep less than over here is it the case that the order will act I mean for this specific array where everything was the same then it preserved the order, but is it going to preserve the order in all cases? If I use less than then two elements which are which have the same month and day, but different years in the final sorted array will appear in the same order as they appeared in the original array if I use less than in this specific case it does, but in general will it. So, what do you think the answer to that is yes or no? In this specific case it does, but in a more general case will it ok. So, maybe I leave you with that food for thought this is actually a very important criterion for sorting algorithms is called the stability of the algorithm. So, if something preserves the order among equals it is called a stable sorting algorithm. If it does not preserve the order it is called an unstable algorithm and we are asking is selection sort stable or unstable ok ok.


Instead he came on back with another let me get right into it baby.  I'm gonna tell you why baby. It might be critical I just want y'all to know it might be critical Why might it be critical? We have an order to pick up. We have a load right on the load board now This load is 46 empty miles 19 loaded miles so 65 miles and we will receive a payment of 125 Now is that the greatest? No, it's not but it is that bad not ready. So it's kind of decent The problem with this order is the drop-off location is the McCormick place Now for those of you who are not familiar with this area, the McCormick place is this enormous But I'll talk about it's huge and the last time we went to the McCormick place. It was a disaster We went there. We had to pay 25 dollars to part We went in this building the lady said maybe corn was weird We did not get anything unloaded because we dropped it off on the wrong day because this bench the dispatch app Sent it at the wrong time. So they may have taken it to a hotel. So it was just a disaster completely now That may be critical. Also, guess what else? We have another one. We have another order We have to do now this one is the one to deliver at and it is going to be downtown Chicago at 250 p.m. Which means it's probably going to be a lot of traffic and It is a huge order. We are going to the mbc building like the tv plate the tv network mbc We're going to that it's a drop-off location And it also consists of another driver and my guy big cj over on his channel He had a disaster order with another driver where he had to pick up and take out everything by itself because the driver never showed Up so look, this could be real. I don't know what we're gonna do We gotta do y'all gonna find out when y'all find out. I want the money not the cloud. Let's go We're here now you old news Just checking at this door right here. They've made sure they put a lot of signs so you cannot mess this up so I don't know how you do it. So I have a pickup to go to the McCormick place Yeah, it's supposed to be it said it's supposed to be seven pieces I'm not sure if this all of it, but this is how it comes into me seven pieces 595 pounds 97 by 15 by 15 This is the order number. Do you have the order number is here That's my tip and just like that my guy about to load this up so we can get our pockets on swallowed up They said it's supposed to be seven pieces, but it's actually only four so we gotta do what we gotta do So to your move it over this way a little bit to your right Yep, we're good right there Perfect. Yeah, it's okay boss. Do you have a good one? Hey, I'm gonna say this you the first will find the second person who didn't hit that thing right there Everybody else boom. I thought you used yeah, you was coming in how I'm like you coming kind of fast, but I appreciate you boss Yep, he the first person they didn't hit. All right, you too He the first person they hit they join you and he was coming in fast. I thought he was I thought he's supposed to hit him to the perp you know And just like that that's game time. It's time for us to shine.  Look last time. This is that where we had to go, baby And we had to pay that 25 dollars right there. So we actually parked across the street and I'm going to walk across I see Last time this lady was tripping it too. So you don't see what happened, baby I'm gonna have this load to drop off. I'm not sure exactly. I'm supposed to go to my first time So you're gonna pull out the parking lot make a lock at the stop sign Line up behind the trucks on the right I'm out the parking lot make a left go down and line up behind the trucks. Yeah on the right hand side On the right hand side. Yeah, there'll be a traffic guy out there for what, you know Okay. All right. Thank you very much Check it out, baby. We are up here. I think we are at a trade show. I'm not sure exactly what this is I think this is where they'd be having the car shows and stuff up here Yeah, this is crazy. This is my first time being here Yeah, that's what I'm saying The last time No, because boy the next to look so so what happened last this is my what's your name? Paco my god, Paco All right, this is for this for youtube right here. I got Paco. Yeah one hour later Now with the photo of your noodles We got everything we need it's time to get back to this green Don't be in between.  So like boosty we can zoom Zoom zoom zoom zoom Let's go order number two We got a delivered order. We are about to do the pickup location is bright walk kitchen The order cost is $325 and 90 cent We're going to drive 1.3 miles and receive a payment of 58 13 we're about to pull up and get this green. Let's go just like that. We are here to pick up Hopefully we had no hiccups, baby. I don't know if we're going to be able to We're gonna have to get our bags or not I don't hope it's instead. That's why it's called loudest I don't have an easy catering order to pick up. Oh, yeah, I got that. I don't know if I need it We're not just taking all those. Okay. All right. Thank you and we are back again clap again I'm about to get these so we get these living in So let's run up right quick. We are good to go. That's everything, right? All right. Appreciate you walking. Have a good one Y'all see what's going on, but they're going here and getting on my nickname wrong. I'm rocking on a microphone I'm in my zone. Let's go Hello, how you doing, sir? I'm have a drop off for WP partners. I'm supposed to go to a sweet 3,700 All right, let me get you on the other bed Andrew, maybe you like it a little bit Yeah, I'm good with that I love me a little 37s. We're going to 37 flow it and bring up Oh Okay, you just set it up here No, I just need to set it up and then take a picture of this And I am good to go. Thank you very much. You have a great one And last but not least we got another order on dli vr db But the puller right now so we can get this cheese delivered app We got another order on the delivered app. The pickup location is smash burger. We are going to pick up $2,398 and 40 cent worth of food We are going to drive point five miles. It's going to be a 160 items and we will receive a payment of 144 I certainly took this order, but I was thirsty for the dough. Let's go We are here at the pickup location. Guess what? The other person is not here. So I don't know I guess why I'm pulling out the dolly. I know they guys like some sodas and stuff So we're going to see what we got to do. I know my clothes stick like the flu I'm here for that big order Oh, yeah What is supposed to be two drivers? I'm one and two. Yeah Don't hurt what they said the other driver is lost. I told you it's easy to get lost out here Cheese Yeah, I'm the second driver. Are you second driver? Yeah, okay. Yeah Well, did you just call and say you were lost? Yeah. Oh, okay It's I tell people all the time it's so easy to get lost out here. It's easy Even if you live here, it's still easy to get lost That's why they've been sending me them all day and I don't want to do them I don't want to do it. It's a headache. See what's going on, baby We got everything in this joint. My god, are they getting right? We're about to get our pockets tight. Let's go So we what we're doing In the drinks y'all want them on the table or on the floor? Oh I'll put them in the corner over here.  It was a critical day, baby Today was absolutely critical the first order We literally sat there for an extra hour and 22 minutes to get unloaded because they had that whole thing going on They're going back and forth extra extra slow with them fork trucks I'm talking about and then I ain't gonna lie.  I'm talking about at least 50 Like drove past us then they go so do go somewhere else do something else come back drive past us again And we just sitting there baby for an hour and 22 minutes and that put us behind on everything today So instead of us getting there. I think we had to be there by nine We got there at 8 36 and we got out of there by nine We could have went and got busy got us another load and then did that deliver order after that But everything was just messed up. So we ended up getting that second deliver order In the midst right after we got done with that first load We dropped off we got that one and then orders was I mean loads were just pumping in all day long, baby We missed out on so many I'm talking about probably at least Probably at least 11 good loads 125 plus But we had to deliver order at 2 50 p.m So we really couldn't move that much. We had to sit at the first location for an hour and 22 minutes So that put us out to like 11 something they would get that no like 10 something So yeah, yeah around 10 something and then we did that other deliver order at around 11 something And then we had to sit and wait for three hours because all the orders that are coming in They were coming in and like we got to pick up at 2 30. We had to pick up at 1 30 We got to pick up at 3 o'clock. We got to we got to pick up at 3 o'clock We got to pick up at 3 30 so and we could not do any other orders So we literally had to sit around and wait for three hours to get that 144 We kicked down a dough and we went out there to school. So today we made 327 and 13 cent barely enough money to pay the rent We were out for a long time today. It's almost five o'clock. It's 453 We left the house. I left the house at six I left the house at 6 a.m And now that's what I gotta do. I have to go edit the video So y'all just see a little difference in pieces Y'all don't see everything that goes on when I think I don't my nickname wrong Make sure you like it tomorrow because guess what it's going back down because we ain't playing around It's 2023. It's a big bad season. We'll keep on giving reason. I'll see you guys on next one We could we could be fooling you already know the ddk and I'm on my way


What's going on guys welcome back to the channel critical overload here We're gonna be talking about the Texas chainsaw massacre franchise in this video here today So it would appear that a scoop of mine from last weekend. I think it was last weekend Yeah, on Saturday when the world rumble happened. I think it was last Saturday Saturday or Sunday last Saturday I brought out a scoop related to Texas chainsaw massacre and it would appear that that scoop has Gotten some sort of confirmation it would appear from Daniel RPK who has also come across it My issue at the time was that I was under the impression They had already shot the movie because of how it was Presented to me, but it looks like this is a legitimate project. That's just actually in development It has not been shot at all whatsoever, but this is the next chapter of what will come in this franchise So before I go any further I do want to circle back to an article from bloody disgusting two years ago because I think it's relevant to speculate on this so This article from 2022 when Netflix put out their Texas chainsaw film goes as follows It says yes The rumor is that Netflix is looking to order up not just one but possibly even two Texas chainsaw massacre sequels a rumor that bloody disgusting has not been able to confirm We have heard however that Netflix has very much discussed the possibility of potential sequels to their Texas chainsaw massacre movie All dependent on the film's performance We checked with our sources and can confirm Netflix had most definitely discussed plans for sequels ahead of the release performance pending in other words Netflix would gladly bring leather face back for more if enough people stream Texas chainsaw massacre this year. So here's the thing This new film that's in development is called Texas chainsaw legacy for those of you who remember my tweet from last weekend It's the same title same sort of information if you remember it. I'm certain someone out there took a screenshot of it, too however Texas chainsaw legacy the plot details indicate to me This has nothing to do with Netflix's last film That doesn't mean that Netflix isn't involved, but I have doubts that it's Netflix doing this I'm starting to think that it's just going to be legendary and some other distributor But it could still be Netflix time will tell but here's the drop on Texas chainsaw legacy This is from Daniel RPK Texas chainsaw legacy takes us to Oasis Oaks a gated community nestled in rural Texas amidst the meticulously manicured lawns and Vigilant security patrols our protagonist family epitomizes suburban bliss However, looking just beyond the confines of this idyllic enclave lies an abandoned property Home to the infamous leather face and his macabre kin as chaos descends upon Oasis Oaks Ordinary families are pitted against the savage Sawyers in a harrowing battle for survival where the lines between good and evil blur in a chilling confrontation of familial horrors now To me, this sounds like a pretty intriguing story The Sawyers versus a bunch of suburb suburb snobs I would imagine from what I've also heard rumored details even further this Oasis Oaks town is filled with three story houses it has security guards patrolling in golf carts and Yeah, that's that's really the biggest thing I was gonna share about the town It sounds like it could be fun It's it sounds like we could be seeing something like a purge type of deal and when I say the purge I mean that original film by having these people who are ruthless killers the Sawyers going into this area with these Suburb snobs and you just have all chaos and unfold Between the haves and have nots. It's just I think that's what it comes off like We can see how this all comes together once we learn more about Texas chainsaw legacy What do you guys think about this? Are you looking forward to it? Do you think it's gonna be connected to this last film from Netflix? Or do you think Netflix is still involved and they're just decided to do a Another reboot of sorts. That's not even gonna be connected to the last film Let me know all of that down below. Are you looking forward to it? Why are we not are you just tired of Texas chainsaw movies? What is your favorite Texas chainsaw movie? Let me know all that down below if you haven't already, of course Make sure you subscribe turn on post notification like never miss video in the description. I'll have links to all of my social media accounts I'm on Facebook Twitter and Instagram you can message me there, of course Let me know if there any movies news reviews you like me to cover in the future and I promise yes I'll start making longer videos. I'm just trying to let my voice recover still and with all that in mind guys I will see you in the next video


this afternoon. I believe that archive is familiar to many of you here, so I will have a very brief introduction. It's more than 20 years old and it somewhat ushered open access to pre-print publications in many disciplines including physics, math, computer science, astronomy, quantitative biology, statistics, so on and so forth. Just to give you a sense of its use, last year we received 64 million downloads for these papers from all around the world. Four years ago at Cornell we started an initiative, a sustainable initiative, in order to plan archives feature from many perspectives, from business, finance, governance, usability, technology. This will be a very very brief overview, so I will just share with you in a snapshot mode a few principles that we tried to either implement or we learned through lessons, but if you are interested in learning more I would suggest that you go to this page with plenty of information about its background and more detailed aspects of how we implemented this initiative. One of the starting points for us in sustainability was to clearly define the value proposition of a public good, public good being archive, accessible globally free to researchers and for that purpose we actually create a very succinct four-page document to describe Cornell's role plus archives core values and in addition we try to identify some of the core stakeholder groups and integrate within value proposition what their roles are. This really shows a somewhat I would say simplified version of the stakeholders that are present surrounding archives operation, but let me give you one example from financial perspective. In means of our membership model we focused on libraries and research laboratories and the reason was that we felt that libraries and research laboratories had been at the focus of at the center of scholarship for years and they naturally have a stewardship role and therefore for us it was a very natural role that didn't involve any conflict of interest to form a membership model and to engage these institutions. From a financial perspective we tried to diversify and actually we are still working on this but this is a snapshot of the current financial model the funds are coming from the Cornell University Library from a scientific foundation and member institutions. Currently we have 173 members representing 22 countries and one of the principles that we are trying to learn is to have transparency about the archive operation including its expenses. Many of us run repositories we have been in this business for years but when it comes to clear to identify what the costs are how they occur and how they fluctuate it is still work in progress. After five years of writing trying to identify annual costs I must admit that we are still trying to you know unbundle expenses or try to kind of more clearly identify what are the sources of revenue and what are the sources of expenses for archive. Another principle that we are paying attention is again along the lines of transparency is the organizational model how we are running archive different roles responsibilities and we also feel that our community is in really desperate need of sharing this sort of information from organization financial perspective how much we are spending what are the skillsets represented and what are the organizational members to be able to build sustainable models collectively. I'm the program director and actually we are in the process of recruiting a scientific director we do thoroughly believe that at the heart of repository initiatives should be collaborations between or among different stakeholders either even if the libraries are taking the lead in sustainable the planning involving scientists in this process is critical and along that line this is how our governance model looks like Cornell University library has a set of roles especially managing the moderation of submissions operating archive thinking about long-term access from preservation perspective financial responsibility and we work very closely with two advisory boards and both of these advisory boards have bylaws so that members of these boards clearly know what their roles are and what their contributions are and how they are involved in the archives day-to-day operation. Again I want to emphasize that archive success stems from it's coming from the scientific community and after 20 years we are still trying to give prominence to the scientists roles their needs and their sociocultural issues therefore a very important part of our governance model is the scientific advisory board and their involvement in sometimes even day-to-day operation. We also have a member advisory board that represents libraries and repository communities because we think equally important as intellectual oversight of archive is engaging the global repository community in running the repository including interoperability standards development priorities so on so forth as I said given the short duration of this presentation I'm just giving you kind of sampling snapshots but some of the principles that I have included so far I mentioned number one importance of academic community number two which is clearly defined mandates and governance governance structure and the fifth one which is reliance on business planning strategies even open access initiatives require business plans because we need revenues we have expenses so we really need to understand that a special nonprofit operations need a clearly identified and transparently communicated business plans again going with my snapshot approach I would like to give you two examples to illustrate number three which is technology related and number four which is about content policies and I'll start with the importance of content policies I would say one of the success principles of archive is quality control which may not be a very kind of obvious process for you but in a very simple sense we are receiving 230 to 250 articles every day at Cornell and our staff is doing a very personal review of each paper received just to make sure that these are actually scientific papers they have been submitted by legitimate authors that they are coming from a certain institution and that to identify different subject categories using automated tools but a very critical element of this process is we have engaged close to 140 scientists from all over the world and each paper submitted even if it's just one minute glance is looked over a scientist to make sure that we are maintaining the quality parameters as I said this is not necessarily maybe a very well known aspect of archive but I want to emphasize that maintaining an open access repository doesn't mean that we should accept everything that for the stability and the quality of the scholar enterprise I think it's very important that we all based on our own content policies define even if a very lower level some quality parameters the other issue that I want to mention to you is again as a success principle for archive we gather minimal metadata because we want to make this deposit process very fast very robust therefore we have to sacrifice we librarians love metadata right especially with the new obligations with funding sources so on so forth research data we are so in a way you know we have we have incentive to add and request more data from authors but we firmly believe at this point that with authors as we speak with scientists it's very important to keep the barrier of ingest the barrier of submission very low unless your organization is in a position to invest in submission staff where the staff would be monitoring and adding articles to your repository the other issue I want to mention is last five years we are very well aware of the importance of research data and especially we are very much involved in creating an integrated scholar communication environment where we have preprint published article postprint research data images so on so forth are presented and discovered in an integrated way with archive a couple of years ago we were involved in a research study with data data conservancy from John Hopkins to experiment with using archive as a front-end interface to accept research data too actually I'll be glad to give you if you're interested in the URL for a blog article that we published about this experiment but what I want to share with you is that with research data the most complex things about small data after running it for two years we were just surprised to see that as we are talking about research data what we are seeing coming from our researchers is many small data sets and sometimes very difficult to identify some articles they might have 20 data sets deposited but in means of understanding you know how these data sets relate to each other how they relate to the article so on so forth that is not very clear and I wanted to offer this as an example of sustainability because as we focus on this cutting edge and innovative features sometimes what will define sustainability and usability is attention to daily operational issues such as this one so these are my very quick remarks thank you for the opportunity okay next we're going to hear about Jura space we have here Michelle Kimpton who is a chief