CS106A: Lecture 18

Array Lists

Pros and cons of array lists

If you know the size of your array beforehand (fixed size), almost always go with a regular array, not an array list.

Debugging

Different hats a programmer wears. Architect hat during the design phase, engineer hat during coding phase, etc.

The 4 Ds of software

Any problem (i.e. bug) that cascades from one step to another causes a factor of 10x in the cost to fix it…

CS106A: Lecture 15

Passing stuff around

Passing by value means u get a copy (e.g. with primitive types)
Passing by object reference means the mafia thing (min 9:15).
passing objects around is like talking to the mafia…
So if you’re gonna mess with the obj that’s being passed around, know that you’re changing the actual obj (not a copy).

Difference between passing by value and passing by object reference

Exceptions

What are they and how to deal with them (min 24:45).

Dereference

Means go through the reference. Explanation involves little Mehran taking a chainsaw to the Mona Lisa (min 11:23). LOL

Mehran explains dereference

Working with files

Create, read, erase files. Compares working with files to running with sharp scissors (min 15:00).

CS193P Assignment 2: Extending our Calculator

This assignment’s topics (memory management, properties, some Foundation classes) are covered in lectures 3 & 4. Paul demos this assignment at the end of lecture #4.

I’ve read up to ch5 so far… I’ll just keep reading from there and will come back to this assignment when I finish ch11.

Downloads

Assignment 2 [PDF]

CS50: Week 7 (monday)

Topics: Stacks. Queues. Valgrind. Bitwise operators. Hash tables. Trees. Binary search trees. Tries.

typedef= synonyms for data types.
string= 1st byte of an array of characters.

NULL’s type is a pointer (it’s typedef’d). “Points to what? Idk but it’s not zero. It could point at anything.”

they are different data types

array- you must know the size in advance. If you go too far, you segfault.

Linked lists vs. arrays (min 22)

queue- a data structure (FIFO)

With what data type could you implement a queue? an array

A data structure has data associated with it and also typically some standard operations (e.g. sort, insert, delete)

Stuff that went over my head

hash tables