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
what is a global variable
can be used any where within the program after being declared.
26
what is a local variable
can only be used within the structure they have been declared in e.g. within a procedure/functions
27
local variable
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
what is a database
a persistent collection of data stored together in an organised or logical way.
29
what is a record
a row of data in a table.
30
what is a field
a column
31
what is a primary key
a field that uniquely identifies each record
32
what is a wildcard
star and means all
33
what does select mean in sql
extract records
34
how is sql set out
SELECT * FROM _______ SELECT * FROM _____ WHERE type = ____
35
what can u change * to
any of the titles in the data base
36
what is input validation
checks to see if inputs from the user meet certain criteria before being passed into the program.
37
what are the 6 different validation checks
digit format length lookup presence range
38
what is check digit
the last one or two digits are used to check if the others are correct
39
what is input sanitation
remove any unwanted characters from a user input when entering data.
40
what is authentication
used to confirm the identify of a user before they're allowed to access a system or certain features in it.
41
what are the 4 types of authentication
passwords random character selection two-factor authentication fingerprint
42
4 ways to make a program more maintainable
adding comments indentation meaningful variable names sub programs
43
`what are the two main types of testing
iterative testing - test the code as you create it final testing
44
what are the 5 test datas
valid out of range extreme null value invalid
45
what are syntax errors
due to grammar and prevent the program from running.
46
what are logic errors
an error that occurs when the program does not run in the way it was intended to.
47
what is machine code
Binary data. Each binary instruction carries out one CPU instruction. Difficult to understand by humans
48
low level
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
high level language
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
what are the two types of translator
complier interpreter
51
what is a complier
high level language to machine code Converts entire program at once. Error log is given can be run on any computer
52
what is an interpreter
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
what is an IDE
used to help create code in a high level programming language
54
what are 4 types of IDE
source code editor error diagnostics and debugger run-time environment automation tools
55
what is the source code editor
Text editing area where you can write your program. Colour codes command words Automatically indents to make code easier to read
56
what is the error diagnostics and debugger
Identifies potential problems in the code (warnings) Lists errors in the code, what they are and where they can be found.
57
what is run-time environment
allows the code to run while still being created does not complie the code just runs it
58
what are automation tools
Wizards that autocomplete code as it is type. Can provide documentation that shows all variables, sub-routines and comments etc.