Other Flashcards
What is a Factorial?
A shorthand way of expressing the product of numbers
e.g 5! = 5x4x3x2x1
What is 6!
720
Can 6! be written as 6 x 5! ?
Yes
What is 0! ?
1
What is the Factorial Function?
n! = n x (n - 1) !
What are the Essential Characteristics of a Recursive Routine? (3)
- 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
What does does a Stopping Condition do?
Means that the routine will not call itself
What happens every time a Subroutine is called?
The return address (the line after the CALL statement) is put on the call stack
Why can a Recursive Routine only be called a limited number of times?
If it is called too many times, the stack will overflow the maximum memory capacity
What is a Fibonacci Sequence?
A sequence where each number is found by adding the 2 preceding numbers
Which usually takes less line of code? Recursive or Iterative?
Recursive
Which is faster? Recursive or Iterative?
Iterative
What were GPUs originally designed for?
Creating images for computer graphics and video game consoles
What have GPUs also been used for?
Accelerating calculations involving massive amounts of data
How does a GPU compliment CPU architecture?
By allowing repetitive calculations within an application to be run in parallel while the main program continues to run on the CPU