Key words and terms Flashcards
What is an array?
Data structure for storing finite / ordered set of data using same data type.
Compare local variables with global variables.
Local:
- Limited scope - only accessed within subroutine they are defined.
Global:
- Accessed throughout whole program. Useful for values accessed by multiple parts of program.
Local > Global:
- Local are self contained - not affected outside of subroutine
- Global can be unintentionally overwritten.
- Global not deleted until program terminates - uses more memory.
What is a Boolean?
Data type that can only store 2 possible values (1 / 0, TRUE / FALSE)
What is a character?
Data type for storing a letter / number or special character
What is a data type?
Attribute determining what type of data is being stored
What is a pointer / reference?
Data type used to store memory addresses of objects created at runtime
What are records?
Data structure which stores related data in ‘fields’ - organised based on attributes.
What is assignment?
Statement for giving created variable value consistent with data type.
What is constant declaration?
Statement for creating a constant in a program
What is iteration?
Programming structure where set of statements are repeated in fixed number of times.
What is selection?
Programming structure for deciding which statements to perform next based on certain conditions.
What are subroutines
Uniquely named section of code written to perform a set of conditions.
What are stackframes?
Store return addresses, parameters and local variables for each subroutine call.
What is variable declaration?
Statement for creating a variable in a program
What is an arithmetic operator?
Operator taking 2 numeric values and performing some form of mathematical manipulation.
What is truncation?
Removing decimal place without rounding
What is concatenation?
Process of combining 2 strings into a singular larger string.
What is exponentiation?
Arithmetic Operator that raises numeric value to power of other numeric value and returns result.
What is modulo?
Arithmetic operator that divides numeric value by another and returns remainder.
What is recursion?
Defining a problem in terms of itself.
Calling a function within itself.
What is the Procedural Programming Paradigm?
Programs formed from sequences of instructions, executed in the order they appear.
What is encapsulation?
Name for combining methods and procedures to form an object.
Forms a single entity which holds the objects properties and methods.
What is inheritance?
A class can inherit another class which allows it to share properties and methods.
What is polymorphism?
Occurs when objects are processed differently depending on their class.
What is overiding?
When a method has the same name as a method in an inherited class, but with a different implementation.
What is association?
When 2 objects are described as having a ‘has a’ relationship - car and driver - car has a driver.
What is aggregation?
When an object is associated with another, it will still exist if containing object is destroyed
What is composition?
Objects associated with composition, if the containing object is destroyed the associated object is also destroyed.
What is Encapsulation?
Method of bundling attributes and methods together within a class
What is inheritance?
Subclasses inheriting methods of and attributes of its parent class
What is instantiation?
Creation of an object from a class
What is overriding?
Redefinition of a method in a subclass
What is polymorphism?
Objects of different classes using the same method to perform an action.
What are the principles of OOP?
- Favour composition over inheritance
- Encapsulate what varies
- Program to interface, not implementation.
What are dictionaries?
Data structure consisting of a set of keys mapped to corresponding values.
What is an adjacency list?
Representation of a graph by storing a list of connected nodes to each node
What is an adjacency matrix?
Representation of a graph which stores edges connecting possible nodes.
What is convex combination of 2 vectors?
Any vector which can be expressed as a linear combination of the two vectors
What are dot / scalar products of two vectors
Sum of components with the same index of the 2 vectors
what is scalar-vector multiplication?
Operation which multiplies all components of a vector by the same scalar quantity
What is vector addition?
Operation which adds 2 vectors resulting in another vector as the output.
State the Big O time complexities.
O(1) - Constant
O(log n) - Logarithmic - Binary search
O(n) - Linear - Linear search
O(n log (n)) - Loglinear - Merge sort
O(n^2) - Polynomial - Bubble sort
O(2^n) - Exponential
What are algorithms?
Sequence of steps taken to complete a task
What is abstraction by generalisation?
Simplifying a problem by grouping together common characteristics of a problem.
What is representational abstraction?
Simplifying a problem by only considering necessary details.
What is procedural abstraction?
Simplifying a problem by breaking it down into a series of reusable functions to produce a procedure
What is data abstraction?
Storage and representation of data in a computer system.
What is decomposition?
Breaking down a problem into sub-problems.