algorithims Flashcards

1
Q

what is decomposition

A

the process of breaking down a problem into smaller more managable parts which are easier to solve

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

what is abstraction

A

ignoring or filering out the unnecisary deatils that arent important

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

algorithms

A

method of planning to show how you can solve a problem that you have

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

what does the cylinder mean

A

start or end

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

what is process

A

square

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

what is input or output

A

paralellogram

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

what is decision

A

diamond

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

what are the 2 searching algorithms

A

binary and linear

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

what is linear search

A

It just works it way through the list one at a time until it finds the one it is looking for.

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

what is binary search

A

finds the middle value
Compare to the value you are looking for.

IF it is the value you are looking for.

    Celebrate, and stop.

ELSEIF it is larger than the one you are looking for.

    Take the values to the left of the middle value.

IF it is smaller than the one you are looking for.

    Take the values to the right of the middle value.

Repeat with the new list.

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

what are the 3 sorts

A

bubble
merge
insertion

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

what is bubble sort

A

Look at the first two items in the list

If they’re in the right order, do not swap, if they’re not then swap them

Move onto the next pair of items (2nd and 3rd) and repeat step 2

Repeat step 3 until you get to the end of the list – this is called one pass.

Repeat steps 1-4 until there are no swaps in a pass (this means it is in order)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

when is a pass over

A

when you get to the end of the list

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

benefits of bubble sort

A

It is a simple algorithm that can be easily implemented

It is an efficient way to check if a list is already in order

Doesn't use much memory as all the sorting is done on the original list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

drawbacks of bubble sort

A

inefficient
doesnt cope well with large lists

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

what is insertion sort

A

Start with the second item in the list, the items to the left of it are known as the sorted list.

Compare it to the items before it (in this case just the first item) and insert the value into the right place.

Repeat step 2 for the third, fourth etc items until the last number in the list has been inserted into the correct place.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

benefits of insertion sorts

A

It copes very well with small lists

Doesn’t require much memory

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

benefits of merge sort

A

good for larger lists
consistant running time

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

what are the 3 programming constructs

A

sequencing
selection
iteration

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

what is iteration

A

this is when the program repeats a set of instructions inside a loop until a condition is met.

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

what is selection

A

this is where the path through a program can be decided by looking at a condition

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

what is sequencing

A

when a program follows a list of instructions in order (top to bottom)

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

how to retrieve elements from an array

A

you use the array name followed by the element that it is in.

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

how to create a 2d array

A

names = [[“Sally” , “John”] , [“Tristan” , “Claire”] , [“Adam” , “Michelle”] , [“Glynnis” , “Charlotte”]]

25
Q

what is a global variable

A

can be used any where within the program after being declared.

26
Q

what is a local variable

A

can only be used within the structure they have been declared in e.g. within a procedure/functions

27
Q

local variable

A

Variables declared in a subprogram are local variables, the rest of the program cannot see them.
they can only affect the part of the program that they are a part of.
global variables can be difficult to keep track of what they contain, especially in big programs.
local can be reused multiple times as long as they are declared in different subprograms.
global cannot be reused elsewhere in the program.

28
Q

what is a database

A

a persistent collection of data stored together in an organised or logical way.

29
Q

what is a record

A

a row of data in a table.

30
Q

what is a field

A

a column

31
Q

what is a primary key

A

a field that uniquely identifies each record

32
Q

what is a wildcard

A

star and means all

33
Q

what does select mean in sql

A

extract records

34
Q

how is sql set out

A

SELECT * FROM _______

SELECT * FROM _____ WHERE type = ____

35
Q

what can u change * to

A

any of the titles in the data base

36
Q

what is input validation

A

checks to see if inputs from the user meet certain criteria before being passed into the program.

37
Q

what are the 6 different validation checks

A

digit
format
length
lookup
presence
range

38
Q

what is check digit

A

the last one or two digits are used to check if the others are correct

39
Q

what is input sanitation

A

remove any unwanted characters from a user input when entering data.

40
Q

what is authentication

A

used to confirm the identify of a user before they’re allowed to access a system or certain features in it.

41
Q

what are the 4 types of authentication

A

passwords
random character selection
two-factor authentication
fingerprint

42
Q

4 ways to make a program more maintainable

A

adding comments
indentation
meaningful variable names
sub programs

43
Q

`what are the two main types of testing

A

iterative testing - test the code as you create it
final testing

44
Q

what are the 5 test datas

A

valid
out of range
extreme
null value
invalid

45
Q

what are syntax errors

A

due to grammar and prevent the program from running.

46
Q

what are logic errors

A

an error that occurs when the program does not run in the way it was intended to.

47
Q

what is machine code

A

Binary data.

Each binary instruction carries out one CPU instruction.

Difficult to understand by humans

48
Q

low level

A

Uses commands words to make it easier for human to follow.

Each line of code translates to one CPU instruction

Not transferable across CPUs as they have different instructions.

Must be translated by an assembler before a CPU can understand the instructions.
49
Q

high level language

A

Easy to understand by humans as it is like the English language.

High level language code is known as source/object code.

One line of code can carry out multiple CPU operations.

Can be used across different CPUs.

Must be translated to be understood by the CPU.
50
Q

what are the two types of translator

A

complier
interpreter

51
Q

what is a complier

A

high level language to machine code
Converts entire program at once.
Error log is given
can be run on any computer

52
Q

what is an interpreter

A

Converts one line at a time looking for errors.

If errors are found it will let you know where the error is and it will need to be corrected before moving on.

Makes it easier to debug programs as it does one line at a time.

Full program not generated into machine code, therefore to run on another machine you would still need a translator.

53
Q

what is an IDE

A

used to help create code in a high level programming language

54
Q

what are 4 types of IDE

A

source code editor
error diagnostics and debugger
run-time environment
automation tools

55
Q

what is the source code editor

A

Text editing area where you can write your program.

Colour codes command words

Automatically indents to make code easier to read
56
Q

what is the error diagnostics and debugger

A

Identifies potential problems in the code (warnings)

Lists errors in the code, what they are and where they can be found.
57
Q

what is run-time environment

A

allows the code to run while still being created
does not complie the code just runs it

58
Q

what are automation tools

A

Wizards that autocomplete code as it is type.

Can provide documentation that shows all variables, sub-routines and comments etc.