Flashcard Deck · 21 cards · Public

CS106A - Programming Methodologies (Stanford)

Master Stanford's foundational computer science course with high-yield flashcards covering object-oriented programming, memory management, decomposition, control flow, and data structures.

Cards in this deck

(21 cards)

Preview terms and definitions before starting your study session.

#1
Term
Karel the Robot Primitives
Definition
The basic, unalterable built-in actions Karel can perform: move(), turnLeft(), pickBeeper(), and putBeeper(). Complex actions like turnRight() must be built via decomposition.
#2
Term
Decomposition (Top-Down Design)
Definition
The algorithmic strategy of breaking a complex problem down into smaller, manageable, and reusable subproblems (methods). Each method should perform a single well-defined task.
#3
Term
Primitive Types vs Reference Types
Definition
• Primitive types (e.g., int, double, boolean, char) store raw values directly on the stack.
• Reference types (e.g., Objects, String, arrays) store memory addresses pointing to objects on the heap.
#4
Term
Variable Scope
Definition
The block of code { ... } within which a variable is declared and accessible. Local variables exist only within their enclosing method/block, whereas instance variables persist for the lifetime of the object.
#5
Term
Pass-by-Value Mechanics
Definition
Java is strictly pass-by-value. For primitives, a copy of the actual value is passed. For objects, a copy of the memory reference is passed, meaning internal object state can be mutated, but reassigning the reference variable itself won't affect the caller.
#6
Term
The Stack vs The Heap
Definition
• Stack: Fast, structured memory storing active method call frames, local variables, and primitive values.
• Heap: Flexible memory space where dynamically allocated objects and instance variables reside.
#7
Term
Short-Circuit Evaluation
Definition
Logical evaluation where operations stop as soon as the result is determined:
• A && B: If A is false, B is not evaluated.
• A || B: If A is true, B is not evaluated.
#8
Term
For-Loop vs While-Loop
Definition
• Use a for loop when the number of iterations is known in advance (definite iteration).
• Use a while loop when iterating based on a condition that changes during execution (indefinite iteration).
Showing 8 of 21 cards in this deck.
Study All Now

Related Flashcard Sets

Explore similar study materials created by the community

Browse community decks