Other Flashcards

1
Q

What is a Factorial?

A

A shorthand way of expressing the product of numbers
e.g 5! = 5x4x3x2x1

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

What is 6!

A

720

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

Can 6! be written as 6 x 5! ?

A

Yes

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

What is 0! ?

A

1

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

What is the Factorial Function?

A

n! = n x (n - 1) !

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

What are the Essential Characteristics of a Recursive Routine? (3)

A
  • A stopping condition / base case
  • For inputs other than the stopping condition, the routine must call itself
  • The stopping condition must be reached after a finite number of calls
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does does a Stopping Condition do?

A

Means that the routine will not call itself

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

What happens every time a Subroutine is called?

A

The return address (the line after the CALL statement) is put on the call stack

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

Why can a Recursive Routine only be called a limited number of times?

A

If it is called too many times, the stack will overflow the maximum memory capacity

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

What is a Fibonacci Sequence?

A

A sequence where each number is found by adding the 2 preceding numbers

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

Which usually takes less line of code? Recursive or Iterative?

A

Recursive

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

Which is faster? Recursive or Iterative?

A

Iterative

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

What were GPUs originally designed for?

A

Creating images for computer graphics and video game consoles

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

What have GPUs also been used for?

A

Accelerating calculations involving massive amounts of data

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

How does a GPU compliment CPU architecture?

A

By allowing repetitive calculations within an application to be run in parallel while the main program continues to run on the CPU

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

What is the main difference between CPU and GPU?

A

A CPU is designed to handle a wide range of tasks quickly but has a limit on the concurrency of tasks that can be running. A GPU is designed to quickly render high-resolution images and videos concurrently