Itty Bits Flashcards

1
Q

byVal vs byRef:

A

By value: A copy of the value is passed.
By reference: The address of the parameter is given so it will be updated at the given address.

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

Local variables vs global variables

A

Local variables:
+ Ensures subroutines are self contained
+ Requires less memory

Global variables:
- Can be unintentionally overwritten
- Take up more storage

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

Recursive methods advantages and disadvantages

A

+ Efficient use of code
+ Tail recursion: Less space is required
- If it calls itself too many times, that could result in stack overflow, causing a crash
- Difficult to trace

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

Concurrency advantages and disadvantages:

A

Each task is given a slice of processor time
+ Number of tasks is increased
+ Less time wasted waiting for an input, as other tasks can be completed
— Can take longer to complete when there’s a large number of users and tasks
— Not all tasks are suited to being broken up and performed correctly

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

What does abstraction do?

A

Hides information that is too complex or irrelevant to the systems purpose
Enables more efficient software design
Reduces time spent on project

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

Modular programming

A

Splitting tasks into smaller moduals.
Top down approach:
Continually broken down into sub-problems, which each can be represented as single task

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

Backtracking

A

Methodically visiting each path, and if a path is found to be invalid, bacingtracking to the previous stage and visits an alternate path
Example: Depth-first traversals

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

Quick Sort

A

Selects a central element called a pivot
Elements smaller than the pivot are placed on the left (as close to the centre as possible, working through from the centre outwards), and elements larger are placed on the right.
This process repeats recursively on each new list until all elements in the lists are old pivots or have a length of 1
Old pivots are ignored
Pivot reads from centre outwards

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

Merge Sort Tip

A

The parts are called elements

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

Binary Search Tip

A

Biases to the right

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

Depth-First Traversal

A

Same as post-order
Goes as far down into the tree as possible before backtracking
Uses a stack

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

Breadth-First traversal

A

Uses a queue

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

Decomposition defintion

A

Breaking down the problem into smaller solutions

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

Decomposition benefits:

A

+ Easier to manage
+ Development teams can be deployed
+ Parts can be worked in parallel
+ Easier to locate errors within specific moduals
+ Without it, testing would have to be done all at once.

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