This video effectively uses community interaction to make fundamental algorithms accessible and engaging for beginners. It successfully turns a standard coding assignment into a clear, practical demonstration of computational efficiency.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
I passed my coding class, thanks to Twitch chat!Added:
I have my um my smart person glasses on.
We are doing a coding stream today. I am guessing that it's probably going to take the entire stream time because I have to do two assignments. And I do think that one assignment will actually be really easy because I already did up another assignment that I think is kind of the same thing. So, I'm hoping it'll be really easy, but then we have another one. Um which I don't I don't I don't know. I don't know what it's about targets and min and max and I don't know what that is. Let's begin, okay?
Here Here's our first assignment, okay?
Design a Python application that has an array of at least 20 integers. It should call a module that uses a sequential search algorithm to locate one of the values. The module should keep a count of the number of comparisons it makes until it finds the value. Then the program should call another module that uses the binary search algorithm to locate the same value. It should also keep a count of the number of comparisons it makes dot display these values as a as on the screen dot. What that mean? I don't know what that means.
What that mean?
Okay, no pseudo code, so we're winning.
Boom. Okay. Wait, I have to use a a sequential search algorithm and a binary search algorithm.
It says both.
Or is it Or is that the same thing?
So, we have to make something that sorts it and then we give that to the binary search which then gives that to the sequential search.
Okay, so we can do one sort the array from low to high.
Can I sort it after it's in the sequential search algorithm?
You can just do array sort. We're giving it Okay, so let's remember that.
Array sort.
Okay.
So, we can do that after the sequential.
One sequential search then sort it then binary algo.
algorithm.
Keep a count the number of comparisons it makes and then display values. Okay, so So is there any user input here?
Or is it just like making it's just like randomly generating the 20, right?
User input will be the value to find.
But it's not I I don't understand what we're finding.
A specific value?
Okay, I don't understand cuz it doesn't like directly say that, no?
Look at it that exists in the array.
Yeah.
So it can't just like randomly locate one.
Pick it randomly out of the array. I mean, isn't that what it's saying?
So I don't exactly understand. Is it finding the random integer from the algorithms, but like which algorithm?
What is the point of picking? It like what is that I [laughter] don't understand. Like what what is the point?
The value to find at the beginning.
Picking the integer happens over one.
You do two algorithms to check their efficiency.
All we're doing is making a list of 20 integers, picking one of them, and then coding two separate algorithms to just find the same number in the in that group of 20?
Okay, wait, I got to fix this actually.
Summon. Wait.
array of 20 int.
So I'm going to copy from my other assignment.
Which I think this is the code to summon the 20 ints.
Wait, there's more to it. Wait, there's already a binary search in here.
Wait, can I just use this?
Wait, can I just Wait, wait, wait, wait, wait.
If I copy everything over, right? So, this is the user input.
So, we don't need this.
So, we don't want We don't want this, I don't think.
But, we need it to display the values.
So, it wants it to to display the array and then display It has to display the count of number of comparisons.
This picture is playing how clearly each search found the Okay. So, can we change it then? Can we change it so it like looks better and not copied from my other side?
>> [laughter] >> Keep a count. So, can we make it like actually count? Or is this the count?
Like, it has to display the account. In the else statement, just put both index one and x2.
Should be the amount of value Okay, so like in here?
Like that?
So, like what happens if I run this?
What will happen?
Okay, I don't know like what Okay.
Line 37, target is not defined.
You didn't pick a value.
Oh, yes. How do we How do How do we do that? How do we pick the value?
Random rand int. Okay, yeah, we we do we have learned that.
Assign it to target. So, target equals Okay.
Let's just run it and see what happens.
It exploded. Okay. Missing one required positional argument B in our thing.
Did I miss something?
What the heck is B?
Rand int zero in here?
Okay.
It did something.
The random value is 55.
But then wait, where is 55 in here?
What the heck? Wait, what?
What? And they they didn't find it, but they said both found at minus What does that mean?
Wait, what the Why Okay, why are they sometimes all the same number?
That doesn't make sense to me cuz isn't it Isn't it random? How are they all the same?
Minus one is common convention for your your value doesn't exist. It does suck because I didn't make this, so I don't really know like what it means.
I don't know why it's bugging.
It would always like get almost all the same numbers.
Like I don't understand why or how it happens. Change temp.
Right, index plus one.
Index out the Okay, well, let's let's try to run this.
Okay.
Target found at different positions five minus Okay, so that Did that work?
In main it says short array size, put a hashtag in front of that.
Okay.
So wait, if I run this, these won't go?
Okay, it still went.
Why does >> [music] >> Why is binary it can't find anything?
It's not sorted. Okay, yeah, binary needs to be sorted. Okay. So, it's not sorting is what is happening.
Array equals sorted array.
Okay, I'm like wondering if that is like something I I would know. I'm trying to see.
I don't think so, but like that seems so simple.
Okay, binary still isn't finding it.
Your return is inside the loop.
Oh my god.
Is [laughter] that really it? Is that really it?
Oh my god, let me fix that in my other assignment, too.
Wait, does it work now? This is my other assignment.
Okay. I don't know why This is my my assignment that you can't see, but it like does this. I don't know why. Okay, so I think that's good. They both can find it now, but now the problem is keep count of the number of comparisons it makes.
Display these values on screen. Do we have to make it so where every time it loops, it has to add one to a counter?
So okay, so am I placing Can I play Do I place count at the beginning?
I don't know.
Just like that?
Okay, and then right?
We have to make it display it obviously.
Okay.
I'm going to go to change Oh.
Oh oh oh oh. Okay.
Write down my 65. Here's 165. Sequential search took 13 comparisons to look at the value. Binary search took four comparisons to look at THE THE VALUE.
WOW, IT actually did it. Wait, binary did better.
Binary count is wrong.
How?
You didn't cut three comparisons every loop.
Is that okay?
You're going by one, two, or three depending on which you end up. I mean, does that does that really matter? I think he would he would I would get like penalized for not doing it. It matters.
I have to do plus one if the in the state in the if statement, plus two in the else statement, plus three in the last. Okay, that's easy enough, right? So if you had to do this Oh.
Move the plus one count in into the first if.
Yes, you are right. [music] If you make an array >> [laughter] >> Wait, should we up the array and see what happens?
Okay, let's try a thousand.
Oh my, this took 943.
Okay.
I'm adding up.
Oh my god, 10,000.
Oh my god, it lagged.
Oh it lagged. It lagged.
It Did you see the lag? It actually lagged so bad.
A thousand? Oh my god.
>> [laughter] >> It broke. Okay, what if we add one more zero? Hehe.
Oh, it did it.
91,000.
Oh my gosh, it took 91,000 comparisons.
Okay, so we're just going to do um 50.
Because this is actually what I'm submitting.
Here we go. Okay, honestly it was not too bad, but I don't I like I still don't understand. Like if you ask me to write this without having anything to start with, I would not be able to.
But it's it's not bad. We did it. We did it. Chad did it. I I I didn't do anything. And now we have another assignment, okay? This is good. Let's do our next assignment. The next assignment I think will be really easy. This is the This is the assignment where it says to put my address and phone number in, but I don't think I actually have to. But it does say to do that, which I will not be doing. Okay. Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also design a program that creates three instances of the class.
One instance to hold your information, the other two to hold your friends or family members' information. Now it says, "Do not include any information of the actual person in the in the program that instantiates."
What is What does this word mean? I Googled it twice and I still don't understand. It means represent. So it's saying, "Do not include any information of an actual person in the program that represents three instances of the class." What does that mean?
Create an instance. Like like a fake.
Right? Like it's not it's not being for real for real saying I have to dox them.
Okay. Now, check this out. You're going to go woah pushing bird. How did you do that? You're going to be so surprised.
Okay, so this is the past assignment where it was all about storing book information and I put my two favorite books. Well, actually I didn't ask Tony.
Okay, he made my stupid odd textbooks textbook. Okay, now we have to put in two books we like. I've never actually finished reading um this book, but it's made by the singer from Japanese Breakfast. Um but I actually finished reading the book.
However, Lord of the Flies is my favorite book. So, that's in there. But anyway, [music] all we have to do is just change all the words to be name, address, age, and phone number instead of title, author, ISBN. Right?
>> [music] >> Okay, I think I'm done. Took a really long time to rename everything.
>> [laughter] >> Oh.
Oh, I didn't put anything in. Hehe.
Okay, what should our first name be?
Doug Dimmadome. Okay.
>> [laughter] >> I think we Okay, we need to like put real people's name. I'm not going to do a character because I don't want my my professor to raise his eyebrows at me.
Matthew Boswell.
No. Okay, what do we do? What do we do?
Um um okay, we can do Matthew Ripley.
Right? Right? Matthew is melons. Okay, I have to put my name though. Maybe I shouldn't put this one first. Okay, then Okay, I'm not going to put my last name on on the stream.
Okay, then who should be my third friend? We could do last name Coolin.
Put my name as lord and savior.
Coolin is a last name, right?
Um >> [laughter] >> Before I put that in my school project as my school assignment, is that like a fake address or is that something like like a real like place? Cuz I was going to put like a like a Arby's address.
It's public info, but like who Whose public info is that?
>> [laughter] >> From Who Okay, who is Matt Bomer? I don't know if he's a real person. He's an actor. Okay, we'll put his phone number.
I'll make my address Wait, what is the What is that museum? Anyone ever been to Wadsworth Atheneum in Connecticut? I went there once and it was actually like the best museum I've ever been to.
Okay, I live in the in the in the Wadsworth Atheneum.
Okay, I'm 21.
Um Matthew Ripley.
>> [laughter] >> You can be um hm Closing my eyes, I'm going to pick.
Two? Okay, I didn't pick anything.
You are 267.
Wait, I I I wrote 67.
Okay, and your address is Matthew Ripley is the president.
Pennsylvania? That's not a road.
I can get banned Wait, can I get banned for this because I'm like typing out fake addresses? I hope not. It's homework. It's It's learning. It's education. I swear.
Okay, I think it's good.
It worked.
Okay, I think we're good. I think that's all it it asked for, right?
That was really easy. It was just mostly me just renaming stuff.
I mean, it's all I have left to to is take an exam.
Eek! OMG OMG Open book exam?
No.
On on the exam it says if you use outside resources which includes any past assignments or the textbook, you get an F.
>> [laughter] >> So
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











