Last Minute Paper 2 Content

0.0(0)
studied byStudied by 7 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/28

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

29 Terms

1
New cards

Abstraction

  • Separating ideas from reality…

  • by removing irrelevant details…

  • to create a focused representation of reality.

2
New cards

How to/why abstract?

  • Remove unnecessary elements…

  • to reduce unnecessary programming…

  • which would require extra computational resources…

  • and detracts from the main purpose of the program.

3
New cards

Realities relationship to Abstraction

  • Abstraction is a simplified version of reality in which…

  • real-world entities are represented as tables in databases and…

  • real-world values are stored as variables and constants.

4
New cards

Thinking Ahead + why do it?

Identifying the…

  • Preconditions

  • Inputs

  • Outputs

  • Reusable components

  • Caching

…of a system.

We do this to maximise efficiency and minimise errors.

5
New cards

Preconditions

Conditions that must be true for an algorithm to complete successfully without errors. For example:

  • A binary search algorithm must be supplied with an ordered list.

6
New cards

Reusable Program Components + Benefits/Drawbacks

  • Commonly used functions are packaged into libraries.

  • Reusable components like:

    • Classes

    • Subroutines (Functions or Procedures)

    • Abstract Data Structures (Queues & Stacks)

  • + More reliable than new code as they’ve been tested.

  • + Saves time, money, and resources.

  • + Can be used in future projects.

  • - Components may need to be modified to be compatible with a project.

7
New cards

Caching + Benefits/Drawbacks

Storing instructions/data in cache memory after they’ve been used as they might be frequently used.

  • + Faster than RAM or Secondary Storage so saves time

  • - Cached data may not reflect latest updates to that data. (E.G a webpage you frequent may be cached, but it may have been updated since you last visited)

8
New cards

What is Thinking Procedurally?

Decomposing a problem to identify it’s components.

9
New cards

Sequence, Selection, and Iteration (Branching)

  • One statement after another

  • Code is executed line by line, from top to bottom


  • Decision-making points (if else, switch case)


  • Loops (for, while, do until)

10
New cards

What is Thinking Concurrently?

Identifying parts of the problem that can be tackled at the same time.

11
New cards

Concurrent Processing

When system appears to do multiple things simultaneously (on one core) but it kinda switches between them really quickly so they are done ‘at the same time’.

  • “One process does not have to finish before the other starts” - mark scheme

  • “Processes are happening at the same time / at overlapping times” + “Only 1 process can actually happen at a time on a single core processor, concurrent tries to simulate multiple processes”

12
New cards

What is a Procedural Programming Language?

A high-level language that gives a series of instructions in a logical order. (what to do and how to do it)

13
New cards

What is a Parameter and how to pass to a subroutine?

Data structures that are passed into a subroutine when called.

  • By Value: A local copy of the data in the variable is used, and then discarded, so the original data is unaffected.

  • By Reference: Reference to the variable's memory location is passed to the function, which means the actual value is affected.

14
New cards

Variables + Scope

Identifier of a memory location used to store data.

The range that a variable is accessible for.

Local Scope:

  • Accessible in the subroutine that it was defined in.

  • Eraed when subroutine ends

  • + Ensures subroutines are self-contained

Global Scope:

  • + Accessible across the entire program.

  • + Risk of being unintentionally edited.

  • - Requires more memory as not deleted until the program ends

15
New cards

What is an IDE? + Features?

Integrated development environment. A single program that is used to develop programs.

  • Syntax highlighting to identify mistakes quickly

  • Stepping to run one line at a time and check the result

  • Variable watch to check the value of variables during execution

  • Error messages to locate errors

  • Breakpoints to stop and test the program works up to certain points

16
New cards

Recursion + Essential features?

  • Routine calls itself…

  • and has a stopping condition…

  • which must occur after a finite number of calls.

17
New cards

Function vs Procedure

A block of code with a unique name to call it to complete a task. Takes parameters.

  • Function is Fun so returns a value.

  • Procedure does not return a value.

18
New cards

Recursion Vs Iteration

  • Recursion:

    • + Fewer lines of code

    • + Better for a problem can’t be solved with a fixed amount of memory.

    • More likely to cause a stack overflow

  • Iteration:

    • + Easier to follow/understand

    • + Faster

19
New cards

Benefits/Drawbacks of Concurrent Processing?

  • + More tasks completed in a given time.

  • + Less time wasted waiting for input/interaction, as other tasks can be completed during the waiting.

  • - May take longer when a lot of users/tasks are involved.

  • - Long to coordinate and switch between processes.

  • - Task may not be suited to be broken up and performed concurrently

20
New cards

Class, Object, Attributes in OOP

  • A Template of an object that defines the state (attributes) and behaviour (methods) of objects.

  • An instance of a class

21
New cards

Benefits of OOP

  • Modular

  • pluggable

  • protected

  • reusable

  • faster development

22
New cards

Encapsulation

  • Bundling attributes and methods together within a class.

  • Ensures data remains secure and is not unintentionally modified (by making attributes private)

  • Hides complexities

23
New cards

Polymorephism

24
New cards

Backtracking

When an algorithm finds a solution by trying different sequences and abandoning a path that leads to an invalid solution.

25
New cards

Data Mining

Identifies patterns and trends in large data sets.

26
New cards

Pipelining

27
New cards

Breadth First Traversal

From left to right, visit children of root/start node. Then visit children of each of those nodes, still left to right. Continuing until every node has been visited.

28
New cards

Depth-first (Post order)

Goes as far into the tree as possible. Goes to the left child node when possible, if not possible then goes to the right. When it get’s to the point of when a node has no children, it visits that node. Backtracks to the previous node, attempts to go right, if it can, then contin

29
New cards

Performance Modelling

Testing a system before it is used by users.