2.1 Flashcards

1
Q

what is abstraction

A

the process of removing unnecesary details ad only including relevant details

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

what is decomposition

A

breaking down complex tasks into smaller manageable tasks

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

advantages of abstraction

A

allows the focus of what is important in problem solving

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

advantages of decomposition

A

makes tasks easier to manage
different people can work on different tasks at the same time, reducing time
program components can be easily used in other components

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

what is algorithmic thinking

A

a way of getting to a solution by identifying the individual steps needed

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

what is an input

A

anything which needs to be supplied to the program to meet its goals

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

what is usually created for an input

A

an appropriate variable name and data type

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

how does algorithmic thinking work

A
  • it creates sets of rules, an algorithm that follows it precisely leads to its solution
  • for example, algorithms for doing multiplications will work 100% of the time if you follow the rules to get the result
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how are structure diagrams created

A
  • they are produced using the method, step-wise refinement
  • the problem is broken down using decomposition into smaller components (some problems will need more decomposition than others)
  • the lowest level nodes should achieve a single task
  • these can then be coded as a single or sub-program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what do outputs do

A

they consider what the program needs to output
consider what form this output needs to take
consider an appropriate variable name and data type for any output

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

what is a structure diagram

A

it is a method of designing a solution to a problem by illustrating the problem using decomposition

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

what is pseudocode

A

an alternate text-based way of representing the sequence of steps in an algorithm

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

advantages of using pseudocode

A

it allows us to lay down the logic of a problem without worrying about rules of syntax

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

what is the terminal symbol (oval shaped) in a flow diagram

A

shows the start or end of a process

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

what is the process symbol (rectangular shaped) in a flow diagram

A

shows that something is initialised, processed or calculated

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

what is the decision symbol (diamond shaped) in a flow diagram

A

shows yes or no, true or false

17
Q

what is the input/output symbol (rhombus shaped) in a flow diagram

A

shows an input and output of data to the algorithm

18
Q

what is the subroutine symbol (rectangle with stripes) in a flow diagram

A

it is used to call a subroutine (separate function)

19
Q

what is the line in a flow diagram

A

controls passing between connected shapes

20
Q

name the different types of errors

A
  • syntax errors, which are grammatical rules of programming language
  • they stop code from being translated
  • logic errors, which produce unexpected outputs
  • on their own they will not stop programs from running
21
Q

what is tracing execution

A
  • used for testing the accuracy of an algorithm for logic
  • it involves examining a printed extract of program code and running through the program
22
Q

what is a trace table

A
  • used for noting down any output the program produces
  • each variable present in the program should have its own column in the trace table
  • a new row should be added under any column if the state of a variable changes
23
Q

advantages of trace tables

A

they are a good way to track down logic errors in a problem

24
Q

how does binary search work

A
  • calculate a midpoint in the data set
  • check if that is the item to be found
  • if not…
  • if the item to be found is lower than the midpoint, repeat on the left half of the data set
  • repeat until the item is found or there are no items left to check
  • requires the data set to be in order of a key field
25
advantages of binary search
more efficient than a linear search on average
26
what is linear search
- starting from the beginning of a data set, each item is checked in turn to see if it is the one being searched for
27
advantages of linear search
- does not require the data set to be in order - will work on any type of storage device - can be efficient for smaller data sets
28
disadvantages of linear search
inefficient for larger sets of data
29
what is bubble sort
it sorts an unordered list of items
30
how does bubble sort work
- it compares each item with the next one and swaps them if they are out of order - the algorithm finishes when no more swaps need to be made - in effect it "bubbles" up the largest or smallest item to the end of the list in successive passes
31
advantages of bubble sort
- it is the most inefficient of the sorting algorithms but is very easy to implement - this makes it a popular choice for very small data sets
32
what is merge sort
uses division and creation of lists within lists to sort a list
33
how does merge sort work
creates two or more identical variables from the original list, and solves them individually by merging separate lists in the correct order
34
advantages of merge sort
- very efficient method of performing a sort - works well with larger data sets
35
what is insertion sort
a sort similar to bubble sort except each variable is sorted into its correct data position one at a time
36
advantages of insertion sort
- it is useful for small data sets - it is useful for inserting items into already sorted lists
37
disadvantages of insertion sort
- usually replaced by more efficient sorting algorithms for larger data sets