Extra paper 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How are flags used in bubble sort

A

flag is set if a swap is made in bubble sort
flag reset at end of each pass

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

Linked listrs are

A

Dynamic

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

Important way abstraction can be used in a game

A

abstraction can use symbols to represent elements of problem

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

What does abstraction increase the chance of

A

Creating the program succesfully

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

Depth first

A

Goes left until it cant and it visits that node and backtracks

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

Concurrent processing and individual processes, decribe what they are

A

Threads and each of them has a life line

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

Concurrent processing what sometimes needs to happen

A

One needs to start before a second one has finished

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

Concurret

A

Simulated multiple processes being carried out same time

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

Concurrent

A

Same time/overlapping times

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

What do programmers need to do with concurrent processingg

A

Allow multiple threads

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

Why is insertion preffered over bubble

A

Insertion sort is usually quicker than bubble sort because it minimizes the number of swaps by shifting elements instead of swapping the m

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

Declaritive1

A

Declarative languages are programming languages where you specify what the program should accomplish rather than explicitly outlining how to do it.

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

Why cannot a binary search work on a linked list

A

Items do not have to be in specific order for linked list but this is a requirement for binary search

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

What is autocomplete used for

A

View identifiers and avoid spelling mistakes whilst also speeding up progress

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

Colour coding/syntax highgliyinh

A

Can identify featrues quickly to be used to chech if code is correct

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

What is an insertion sort particularly useful for

A

Inserting items into an already sorted list

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

What are paradigms, dif

A

Way of writing software

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

Why does modular save time

A

Work done in parralel

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

IO have a cartd on this but WHy is performance modelling used

A

To simulate the behaviour of a system before it is used

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

Programming complexity for A* and dij

A

Minimal but if you can show the effects of each one

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

More memory locations needed

A

For local

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

What does quick sort use

A

Divide and conquer

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

What is divide and conquer

A

Taking two or more identical, smaller sub-problems from a larger problem, solving the sub-problems individually and combining their solutions to solve the original larger problem

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

Applications of quick sort

A

Real time situations, medical monitor, aircraft controls and life support systems and defence systems

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

What is quick sort good for

A

Ideal for parralel processing environments and large data sets

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

Why may merge sort use more memory than an insertion sort

A

*
Merge sort might create a new array each time it splits and merges / often implemented recursively which places additional data on the stack
*
Insertion sort does not use any additional arrays/Insertion sort is an in-place algorithm.

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

What should you say on a big o question,

A

what the best/worst case is

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

What does poassing by reference cause with recursion

A

It to crash

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

What can an IDE do with subroutines

A

Tell you the parameters you need to pass into it

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

What do IDE’s allow with running the software

A

Without exiting the software/having to load seperate compiler

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

Advantages of IDE’s

A

User friendly for novices
 Increase speed of writing
 Fewer mistakes
 Increase speed of testing / finding errors
 Collaborative team working facilitated

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

Insertion sort is an

A

In place algo whereas merge is not

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

What data is used for data mining

A

Data from databases and large data serts/big data

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

Data mining can be used to inform

A

Decisions

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

Data mining laws

A

GFPR

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

Variable watch

A

Variable watches are used to monitor the value of specific variables during the execution of a program. This helps in understanding how and when the values of those variables change.

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

Variable watch

A

Traces are used to record the execution flow of a program over time. This can include function calls, executed statements, and various events that occur during runtim

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

Do you have a visited column in A*

A

No

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

Drawback of concurrent processing

A

Concurrency involves overhead in terms of context switching, managing multiple threads or processes, and synchronization mechanisms. This overhead can sometimes outweigh the performance gains from parallel execution.

40
Q

Security of conccurrent processing

A

Concurrency can introduce security vulnerabilities. Improper handling of shared resources and synchronization can expose the system to issues such as data leaks and unauthorized access.

41
Q

Worst case insertion

A

Reverse order

42
Q

Parameters v arguments

A

Parameters: Variables in the function definition.
Arguments: Actual values passed to the function when it is called.

43
Q

Pipelining

A

The result from one process leads into next

44
Q

Reference

A

Keeps the changes after

45
Q

Advantages of global variables

A

Variable doesn’t need passing as a parameter (byref)
* You don’t need to return a value
* Can be accessed from any function / anywhere in the program

46
Q

2 other advantages of reusable components

A

Variable doesn’t need passing as a parameter (byref)
* You don’t need to return a value
* Can be accessed from any function / anywhere in the program

47
Q

When is breadth more efficient

A

Breadth is more efficient when the data
searched for is closer to the root.

48
Q

When is depth more efficient

A

Depth is more efficient when data to be
search for is further down

49
Q

Time complex of breadth and depth

A

Depth is more efficient when data to be
search for is further down

50
Q

Can breadfthor depth use recursion

A

Depth can be written recursively to aid
understanding.

51
Q

Memory for depth

A

Linear

52
Q

graoghs v trees

A

Depth can be written recursively to aid
understanding.

53
Q

Performance modellign tro minimise

A

Simulate/model behaviour of the system (before it is) used under load
* Because it would be too expensive/unsafe/time critical to test the real system

54
Q

Queue for array

A

Queue has head pointer and tail pointer
* When an item is enqueued the tail pointer increments
* When an item is dequeued the head pointer increments

55
Q

2 extra things to do when removing a node

A

Add node E to the empty node list
Replace the content of node E with blank/null/equivalent,

56
Q

Extra thing for adding node

A

Make node K point to null/equivalent

57
Q

Trees

A

1 direcctional

58
Q

Trees and grapghs are bost

A

Dynamic

59
Q

What divisions does decomp use

A

Logical divisions

60
Q

n log n

A

Linearithmic

61
Q

What can by ref cause

A

Crashes

62
Q

What do IDE’s facilitate

A

Collaboration

63
Q

What do compilers allow with runnign

A

Allow code to be run without exiting software/having to load a seperate compiler

64
Q

IDE’s are

A

User friendly for novices

65
Q

Iteration one

A

Harder to undestand but easier to trace

66
Q

Objects are

A

Independant entities

67
Q

Simple oop v procedural queues

A

Objects can declare any instance of this queue but procedural will need each queue to be declared individually and oop would reduce amount of code needed therefore reduce tchance of errors

68
Q

Why would abstraction reduce development time

A

Factors that detract from program are ignored

69
Q

Concurrent example to show like how to answer it with an LOR

A

Having multiple processors handling different requests would increase response time

70
Q

Information hiding makes programs

A

Simpler

71
Q

Disadvantage of large cache

A

Takes long time to search

72
Q

Stakeholders and problem recognition

A

Stakeholders say what they need from the solution.
* This information is used to produce a clear list of system requirements and a
definition of the problem.
* We may consider the strengths and weaknesses of a current system.
* We may consider the required inputs, outputs and the volume of stored data.

73
Q

what do heuristics provide an estimate for

A

Intractable problems

74
Q

Other heuristic things

A

Performance Modelling
* Mathematical method to test loads on systems.

75
Q

backtracking

A

When a leaf node is reached…
* …the traversal backtracks to the leaf’s parent node
* …backtracks to last node with unvisited children

76
Q

Extra thing for problem recognition

A

determine if the problem can be solved with
computational methods

recognition: identifying the need for the
scheduling system, what it will take as its inputs,
what will need to be output etc.

77
Q

Null

A

Does not point to another node, end of list

78
Q

Explain how an item is added to a linked list

A

Check space available in the free list
* Check to make sure freeListPointer is not Null
Add new data item to first free space in free list
* Insert new data item at index freeListPointer
(index 4)
Append e.g.
* Traverse to / locate the end of the list (index 3
‘orange’)
* Set the pointer of the last item in the linked list to
freeListPointer (pointer at index 3 ‘orange’
changes from Null to 4)…
* … update freeListPointer to the location that
new data item pointer is pointing to at present.
(freeListPointer changes from 4 to 5)
* … update pointer from new data item to Null (index 4
pointer changes from 5 to Null)
Prepend e.g.
* Update freeListPointer to point to the location
that the pointer from the first item in the free list is
pointing to (freeListPointer changes from 4 to
5)
* … Update pointer from new data item to
headPointer (index 4 pointer changes from 5 to 1)
* … Update headPointer to the index of new data
item (headPointer changes from 1 to 4)

79
Q

How are reusable components easier to maintain and debug

A

Easier error detection as fix once and it corrects in each place // less likely to
have errors as code is not written multiple times
* Makes it easier to maintain the program

80
Q

Base case

A

May be one or more

81
Q

What is concurrent processing

A

Processes happen at the same time // processes overlap
* One process can start before another one finishes
* Each process is given a slice of processor time
* Different processes can be executed (in parallel) by different processors/cores

82
Q

Merge can apply

A

Concurent processing

83
Q

Another thing for concurrent

A

different processors can carry out different processes for concurrent

84
Q

Grapghs must

A

Cycles

85
Q

What may data mining include

A
  • May include pattern matching
    algorithms
  • May involve anomaly detection
    algorithm
86
Q

Advantage of global variables with simplicity

A

= easier programming,
simpler to follow, easier to debug

87
Q

Concurrent

A

One process does not have to finish before the other one starts

88
Q

Which is recursive

A

Merge

89
Q

Each thread

A

Runs indidually and overlaps

90
Q

Reference v value memory

A

ByValue creates new memory
space…
* ByReference means existing
memory space is used

91
Q

Quick

A

N log n but n squared worse, want pivot to be middle most number

92
Q

In recursion which takes more memory

A

global

93
Q

In larger trees

A

Depth may never return a value

94
Q

Memory for … is linear

A

Depth

95
Q

Depth first time complex

A

O(V+E) For both

96
Q
A