ShmoopTube

Where Monty Python meets your 10th grade teacher.

Search Thousands of Shmoop Videos

AP Computer Science 3.3 Standard Algorithms 175 Views


Share It!


Description:

AP Computer Science: Standard Algorithms Drill 3, Problem 3. What should go in "expression 1" to satisfy the conditional statement?

Language:
English Language

Transcript

00:00

Sorry And here's your smug too Sure Brought to you

00:05

by parentheses there like little hugs You give your computer

00:09

Oh what's The computers sometimes rejects you know like children

00:14

Alright this code is an implementation of a sequential search

00:18

What should go in expression One to satisfy the conditional

00:21

statement That's history Got it right here Potential answers equals

00:28

and yeah that's gotta be it Okay All right Well

00:31

remember those math word problems where the buildup would get

00:34

really convoluted and try to overwhelm you with information Just

00:38

a cloud A simple question like jenny and tony started

00:42

a fruit stand gather jenny is selling the oranges she

00:44

grew which cost ten cents apiece to grow over four

00:47

months She's now selling them for twenty five cents apiece

00:49

that the average rate of twenty per hour Meanwhile tony's

00:52

juggling three apples and dropped one How many apples is

00:55

tony holding Yeah same sort of thing Here we're being

00:58

given a big rambling thing about a search method and

01:01

expressions and conditional statements But looking at the possible answers

01:05

it's pretty obvious We're on lee really being asked how

01:08

to get the number of elements in an array list

01:12

got it all right Well this is one of the

01:14

ways in which standard arrays differ from array list Object

01:18

arrays have a very simple very useful attribute called length

01:21

No joke there that you can look at which will

01:24

return The number of elements in the array goes a

01:26

little like this Yeah but a raylan aren't your usual

01:31

arrays and don't have that exact attributes Instead there's a

01:34

method called size Yeah that's The call with empty parentheses

01:39

Not very different but it goes a little like this

01:43

Which brings us back to our potential answers The way

01:46

to get the array list size is only properly done

01:49

in si size with the empty parentheses or you know 00:01:53.508 --> [endTime] hugs Oh

Related Videos

AP Computer Science 1.4 Standard Algorithms
200 Views

AP Computer Science 1.4 Standard Algorithms. How many times will mystery be called for mystery(n) for n > 1?

AP Computer Science 4.2 Standard Algorithms
191 Views

AP Computer Science 4.2 Standard Algorithms. What kind of algorithm is the following?

AP Computer Science 1.2 GridWorld Case Study and APIs
493 Views

AP Computer Science 1.2 GridWorld Case Study and APIs. What is the direction of the actor?

AP Computer Science 2.3 Classes and Objects
191 Views

AP Computer Science 2.3 Classes and Objects. Which of the following is correct implementation of the Country class?

AP Computer Science 3.4 Inheritance, Abstraction, and Polymorphism
204 Views

AP Computer Science 3.4 Inheritance, Abstraction, and Polymorphism. Which of the following will satisfy the conditional if statement for boo, str,...