flashcards
why a queue is used instead of a stack
- queues are first in first out
- so that the data will be stored in the order they arrive
why is dequeue() a function and not a procedure
because it returns a value
what does best time O(n) complexity mean
- processing time is linear
- directionally proportional to the size of the list
what does average and worst tine O(n²) complexity mean
- processing time is proportional to the square of the number of items in the list
- quadratic
what does worst space O(1) conplexity mean
constant amount of memories used
which direction is breadth and depth in a binary tree
- breadth = horizontal
- depth = vertical
backtracking in a binary tree
when the value is found, the algorithm backtracks following the previous nodes
explain the difference between branching and iteration
- branching chooses which code is run next
- iteration loops through the same code
what does MOD do
returns the remainder
what is one benefit and one drawback of using iteration instead or recursion
- benefit = can’t run out of memory
- drawback = code is longer, therefore mode difficult to understand
explain how decomposition can aid the design of a program
- breaking down code into subroutines
- in order to make it a more manageable problem which is easier to understand
- can tackle each sub problem independently
define pipelining
the result of one process leads to another
name 4 features of an IDE and what they do
- syntax highlighting = the IDE can make the text bold, highlighted, coloured etc to highlight accidental syntax errors
- debugging = runs through code and fixes any errors or bugs
- testing = allowes developers to run code locally (without exiting software) before it is implemented in other developers’ code
- variable watch widow = allows a developer to monitor the value of a variable during execution (during debugging)
other marks
* reduce spelling errors
* fewer mistakes
* user friendly for novices
* increase speed of testing/finding errors
different examples of how abstraction simplifies visuals
- no actual images shown
- items are names/labeled
- simplified layouts with shapes
explain the need for abstraction in the production of a visual
- reduces complexity of design,
- programming
- reduce memory/processing requirements
- could involve a large number of images which take up excessive memory
- reality contains things that aren’t related to a computer program
what is meant by problem recognition and decomposition
- recognition = identifying what the problem is(scope)
- decomposition = breaking down problem into smaller parts (subroutines)
define the term ‘data mining’
searching through data to find trends, specific information
identify 3 pieces of information that data mining could provide a company about sales and how the company could make use of it
- identifying customer trends
- to identify items to sell/offers to send customers
- identify which stores are making the most profit
- to identify what other stores in the area are doing well
- which items are not selling well
- to replace them with other items
define ‘performance modelling’ and one way it can be used to test a system
- test the behavious of the system before it is used
- testing it with a large number of customers/items/orders
one benefit of creating reusable program components
- components can be used in a future program
- do not need to be rewritten/saves time
differences between a graph and a tree
- a graph has cycles
- tree has a hierarchy
- graphs an be directed/undirected
2 advantages of how using visualisations
- visualisations benefit humans rather than computers
- present information in a simpler form to understand
- visualisations can best explain complex situations
explain why a recursive algorithms use more memory than iterative algorithm (2)
- each recursive call creates new variables
- iteration reuses the same variables
describe how a 1D array can be set up and used to push and pop items as a stack
- define the size of the array
- use a pointer to point to the top of the stack
- when an item is pushed the pointer is increased by one
- when an item is popped the poiner decreases by one