1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Stopping condition/base case
condition that needs to be met to break the cycle of recursion
Advantages of recursion
Save time writing code
Disadvantages of recursion
More significant space requirements, danger of stack overflow, difficult to trace
Advantages of local variable
Ensures subroutines are self-contained, variable name can be recycled in other subroutines
Disadvantages of local variables
Can’t be accessed outside of subroutine
Advantages of global variables
Can be accessed anywhere in the program
Disadvantages of global variables
Require more memory (longer lifespan), can accidentally be overwritten
What is modular programming?
Split large program into small self-contained modules. Makes it easier to divide tasks amongst a team.
passing by value
A method of passing arguments to a function where a copy of the actual data is made, allowing the function to operate on the copy without modifying the original data.
passing by reference
A method of passing arguments to a function where a reference to the actual data is passed, allowing the function to modify the original data directly.
Advantages of splitting into sub-procedures
Procedures can be reused, program can be split amongst programmers, speed up completion time by working on multiple procedures concurrently, easier to test modules than whole code
Advantages of concurrent programming
Processes happening at the same time saves time, another task can be completed while waiting for user input for another
Disadvantages of concurrent processing
On a single core processor only one task is actually being processed at once, if tasks are dependent on each other they may need to be completed in order, trying to do a large number of tasks at once means it takes a long time before any of them are individually completed.