2.2 Problem solving and programming Flashcards

(10 cards)

1
Q

Recursion

A

A function that calls itself. Must have base case and recursive case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Recursion vs Iteration

A

Recursion: Elegant for divide/conquer; risk of stack overflow; more overhead. Iteration: Generally faster; uses less memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Global variable

A

Declared outside functions; accessible anywhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Local variable

A

Declared inside function; only accessible within that function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pass by value

A

A copy of the data is passed; original unchanged.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Pass by reference

A

A memory address is passed; original can be modified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a breakpoint?

A

Pauses program execution at a specific line for debugging.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is step-over?

A

Executes current line and moves to next; does not enter called functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is step-into?

A

Enters a called function and debugs line-by-line inside it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a watch variable?

A

Monitors the value of a variable during debugging.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly