Extra paper 2 Flashcards

(96 cards)

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
What is quick sort good for
Ideal for parralel processing environments and large data sets
26
Why may merge sort use more memory than an insertion sort
* 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.
27
What should you say on a big o question,
what the best/worst case is
28
What does poassing by reference cause with recursion
It to crash
29
What can an IDE do with subroutines
Tell you the parameters you need to pass into it
30
What do IDE's allow with running the software
Without exiting the software/having to load seperate compiler
31
Advantages of IDE's
User friendly for novices  Increase speed of writing  Fewer mistakes  Increase speed of testing / finding errors  Collaborative team working facilitated
32
Insertion sort is an
In place algo whereas merge is not
33
What data is used for data mining
Data from databases and large data serts/big data
34
Data mining can be used to inform
Decisions
35
Data mining laws
GFPR
36
Variable watch
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.
37
Variable watch
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
38
Do you have a visited column in A*
No
39
Drawback of concurrent processing
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
Security of conccurrent processing
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
Worst case insertion
Reverse order
42
Parameters v arguments
Parameters: Variables in the function definition. Arguments: Actual values passed to the function when it is called.
43
Pipelining
The result from one process leads into next
44
Reference
Keeps the changes after
45
Advantages of global variables
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
2 other advantages of reusable components
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
When is breadth more efficient
Breadth is more efficient when the data searched for is closer to the root.
48
When is depth more efficient
Depth is more efficient when data to be search for is further down
49
Time complex of breadth and depth
Depth is more efficient when data to be search for is further down
50
Can breadfthor depth use recursion
Depth can be written recursively to aid understanding.
51
Memory for depth
Linear
52
graoghs v trees
Depth can be written recursively to aid understanding.
53
Performance modellign tro minimise
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
Queue for array
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
2 extra things to do when removing a node
Add node E to the empty node list Replace the content of node E with blank/null/equivalent,
56
Extra thing for adding node
Make node K point to null/equivalent
57
Trees
1 direcctional
58
Trees and grapghs are bost
Dynamic
59
What divisions does decomp use
Logical divisions
60
n log n
Linearithmic
61
What can by ref cause
Crashes
62
What do IDE's facilitate
Collaboration
63
What do compilers allow with runnign
Allow code to be run without exiting software/having to load a seperate compiler
64
IDE's are
User friendly for novices
65
Iteration one
Harder to undestand but easier to trace
66
Objects are
Independant entities
67
Simple oop v procedural queues
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
Why would abstraction reduce development time
Factors that detract from program are ignored
69
Concurrent example to show like how to answer it with an LOR
Having multiple processors handling different requests would increase response time
70
Information hiding makes programs
Simpler
71
Disadvantage of large cache
Takes long time to search
72
Stakeholders and problem recognition
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
what do heuristics provide an estimate for
Intractable problems
74
Other heuristic things
Performance Modelling * Mathematical method to test loads on systems.
75
backtracking
When a leaf node is reached... * ...the traversal backtracks to the leaf’s parent node * ...backtracks to last node with unvisited children
76
Extra thing for problem recognition
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
Null
Does not point to another node, end of list
78
Explain how an item is added to a linked list
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
How are reusable components easier to maintain and debug
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
Base case
May be one or more
81
What is concurrent processing
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
Merge can apply
Concurent processing
83
Another thing for concurrent
different processors can carry out different processes for concurrent
84
Grapghs must
Cycles
85
What may data mining include
* May include pattern matching algorithms * May involve anomaly detection algorithm
86
Advantage of global variables with simplicity
= easier programming, simpler to follow, easier to debug
87
Concurrent
One process does not have to finish before the other one starts
88
Which is recursive
Merge
89
Each thread
Runs indidually and overlaps
90
Reference v value memory
ByValue creates new memory space... * ByReference means existing memory space is used
91
Quick
N log n but n squared worse, want pivot to be middle most number
92
In recursion which takes more memory
global
93
In larger trees
Depth may never return a value
94
Memory for ... is linear
Depth
95
Depth first time complex
O(V+E) For both
96