2.2 Problem solving and programming Flashcards

1
Q

What is the main difference between functions and procedures? (2.2.1)

A

Function: must always return single value

Procedure: don’t have to

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

What does the divide and conquer stage entail? (2.2.2)

A
  • Divide: half problem size every iteration
  • Conquer: each subproblem recursively solved
  • Merge: subproblem solutions recombined
  • Simplifies complex problems quickly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the problem recognition stage entail? (2.2.2)

A
  • Stakeholder states solution requirements
  • Information clearly defines problem & system requirements
  • Definable by:
  • Current solution strengths / weaknesses
  • Inputs / outputs / stored data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are heuristics? (2.2.2)

A
  • Non-optimal, ‘rule-of-thumb’
  • Approximate solution when standard too long to find
  • Not perfectly accurate / complete
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are local and global variables? (2.2.1)

A

Local:

  • Only accessible within own subroutine
  • Deleted upon subroutine end
  • Ensures self-containment

Global:

  • Accessed across whole program
  • Useful for use by multiple parts
  • Unintentional editing risk
  • Exists until program termination, uses memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the problem decomposition stage entail? (2.2.2)

A
  • Problem broken into small problems
  • Each subproblem representable as self-contained subroutine
  • Reduces problem complexity
  • Enables reusable component recognition
  • Team division easier
  • Individual design / development / testing
  • Parallel module development, faster delivery
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is modular programming? (2.2.1)

A
  • Splitting large complex programs 🡆 smaller self-contained modules
  • Easier task division between team
  • Simplifies testing / maintenance, individuality
  • Improves component reusability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is performance modelling? (2.2.2)

A
  • Testing various loads mathematically on different OSs
  • Cheaper, less time-consuming, safer testing method, where trial run
    unfeasible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is data mining? (2.2.2)

A
  • Identifying patterns / outliers in large data sets
  • Collected from various sources (big data)
  • Spot trends / correlations not immediately obvious
  • Insights aid future predictions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is backtracking? (2.2.2)

A
  • Methodically builds solution based on correct visited paths
  • Invalid path finding 🡆 backtracking to previous stage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between passing by value and passing by reference?
(2.2.1)

A

By value:

  • Copy of value passed, discarded at end
  • Value outside subroutine unaffected

By reference:

  • Parameter address given
  • Value updated at given address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is recursion, and what are its advantages / disadvantages? (2.2.1)

A

Subroutine calling itself in execution, continues until stopping condition met.

Advantages:

  • Representable in fewer lines
  • Easier expression

Disadvantages:

  • Stack overflow (memory depletion)
  • Difficult tracing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What makes a problem solvable by computational methods? (2.2.2)

A

Solved using algorithms, not impractical resource / time usage

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

What is an IDE and what main features does it provide? (2.2.1)

A

What: Program providing tool set easing writing, development & debugging

Features:

  • Stepping (single-line execution, monitoring effect)
  • Variable watch (observing contents real-time)
  • Breakpoint (setting stop in program)
  • Source code editor (autocompletion, indentation, syntax highlighting)
  • Debugging tools (run-time error detection)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly