- Excellent food for thought when it comes to solving a problem (from Shawn).
What I gave you was basically a functional requirement. Get from Atlanta to Miami.
But to get to the right answer, you have to get to the non-functional things that are important.
Is it about speed?
Is it about safety?
Do I want to see awesome scenery?
That’s one of the things that differentiates a programmer from an architect. Architects work to understand the whole problem space before running off an doing something. Or at least good ones do.
- Nothing done today. 😑
- Reddit: “Recently Graduated from a Bootcamp, here is what I learned.”
- Reddit: “Able to code with no CS degree, getting caught in interviews by fundamental CS questions. What to study?”
- My Pset 4 Recovered Pictures Gallery
- Worked on Project Euler Problem 3: LARGEST PRIME FACTOR
- Solution runs in Big O(sqrt(n))
- This was a slightly faster solution than my first method of just dividing by 2 then adding one and going on up until I hit the largest number not divisible.
- There is no need for an array of factors (the problem doesn’t call for that), just need to keep updating the factor variable with the largest one found, then print that at the end!
- I emailed Sara to see what she thought of the Python intensive online course Rmotr.
- Shawn is right that free > paid, but I think the money is worth the instant feedback and group learning and also the rigid schedule that would give me no excuses to not make it work and push harder.
- My solution to Project Euler #3 HERE
Largest Prime Factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
int largest_factor = 0;
void largestprime(long long n);
long long number = 600851475143;
printf("The largest prime factor of %lli is %i\n", number, largest_factor);
void largestprime(long long n)
int d = 2; //start checking primes at 2
while (n > 1)
while (n % d == 0)
largest_factor = d;
n /= d;
if (d * d > n)
if (n > 1)
largest_factor = n;
- Nothing done today. Too busy packing for San Diego.
- Downloaded Week 5 & 6 videos for plane ride.
- I powered through a lot of videos on the plane ride. Maybe 2.5 – 3 hours worth.
- Rewatched Lecture 1
- Lecture 2
- Scanf-0, Scanf-1, Scanf-2
- File pointers
- Singly-Linked Lists
- I took notes and here they are as a PDF: https://www.dropbox.com/s/dy3ump3fwedniyc/CS50%20Week%205.pdf?dl=0
- I haven’t been able to get the Daily Programmer BASIC challenge done, but the file pointers video really helped so I may be able to actually get it done now.
- MORE VIDEOS
- Doubly-Linked Lists
- CS50 Library
Notes as a PDF here: https://www.dropbox.com/s/zekoyhtho66czx7/CS50%20Week%205%20%232.pdf?dl=0