Unit 2 computing Flashcards

1
Q

What is caching?

A

Predicting the data that will be needed later on in the program and storing it in cache (faster to access)

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

What is prefetching?

A

Where data is requested from main memory before it’s actually required

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

What are the benefits of caching?

A

Improves speed and efficiency of processing

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

What are the drawbacks of caching?

A

Complexity, wrong data can be cached and has to be flushed

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

Can reusing code be a positive?

A

Saves time and resources

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

What is recursion?

A

When a subroutine calls itself within its own subroutine

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

What are the 3 characteristics of a recursive subroutine?

A

Stopping condition, routine calls itself for any value except stopping condition, stopping condition reachable within finite number of times

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

What does IDE stand for?

A

Integrated development environment

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

What is the purpose of an IDE?

A

To provide a range of tools and features that help speed up and enhance program development

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

What are examples of features in an IDE?

A

Code editors, error diagnostics, run-time environments, translators and auto-documentation

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

What is an example of an IDE?

A

Python IDLE (Integrated Development and Learning Environment)

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

What is a run-time environment?

A

Software that supports the running of programs allowing programmers to easily run code during development

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

What is done in auto-documentation?

A

Variables and modules are tracked with a view to produce documentation that aids in program maintenance, debugging and support

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

What are the two rules of Big O notation?

A

Remove all terms except one with largest exponent, remove any constant from this

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

What does O(1) mean in Big O notation?

A

Constant - always executes in same amount of time regardless of data set

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

What does O(log n) mean in Big O notation?

A

Logarithmic - complexity grows slowly in proportion to number of items in list

17
Q

What does O(n) mean in Big O notation?

A

Linear - direct correlation between input size and time taken

18
Q

What does O(n²) mean in Big O notation?

A

Polynomial - impact of algorithm is directly proportional to the square of the input size

19
Q

What does O(2ⁿ) mean in Big O notation?

A

Exponential - time taken to execute algorithm doubles with each item added

20
Q

What characteristics will an O(1) algorithm have?

A

No loops or iterations

21
Q

What characteristics will an O(log n) algorithm have?

A

Halving data set

22
Q

What characteristics will an O(n) algorithm have?

A

A singular for or while loop

23
Q

What characteristics will an O(n²) algorithm have?

A

Nested loops

24
Q

What characteristics will an O(2ⁿ) algorithm have?

A

Recursion (if it calls itself twice)

25
Q

How do you execute a pre-order tree traversal?

A

(node-left-right) Output root, mark count on left of each node when drawing traversal

26
Q

How do you execute an in order tree traversal?

A

(left-node-right) mark count on bottom of each node when drawing traversal

27
Q

How do you execute a post order tree traversal?

A

(left-right-node) mark count on right of each node when drawing traversal

28
Q

What is a linked list?

A

A list which provides a foundation for other structures to be built

29
Q

How does a linked list work?

A

Each node has a pointer indicating to other nodes in the linked list

30
Q

What does the pointer point to when there are no more items in a linked list?

A

Null

31
Q

When would you pass values in a function by value rather than by reference?

A

When the original values don’t need to be changed