2017 Flashcards

1
Q

Max comparisons in a binary search

A

Finding power of two greater than items in the list

Eg List size 5 2^3=8 so 3 is answer

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

No of comparisons in a linear search

A

N/2 (n is number of items in the list)

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

Linear Search facts

A

Simple algorithm
List may be unsorted
Number of comparisons given by n/2
Slow for large lists

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

Binary Search facts

A

Complex algorithm
List must be sorted
Max comparisons given by power of two greater than items in list eg 5 items would be 2^3=8 so 3 is answer
Fast for large lists

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

Why selection sort two lists is inefficient

A

Has to check every item from list every time loop executes

Requires second list with same storage space as first= problem if large list being sorted

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

Comparing Binary and Linear Search

A

Binary search requires list to be sorted - more complex so more processor time
Linear search more efficient on smaller lists

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

Bubble sort facts

A

No additional operation memory as swaps items between positions in a list
Faster for a partially sorted list as variable can be introduced to keep track of whether swaps have occurred or not
Unconditional version will make n passes through list and n^2 comparisons
In worst case scenario - reverse order = n^2 swaps also
Number of swaps depends on how partially sorted original list is

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

Insertion Sort number of passes

A

Always n-1 where n is the number of items in the list
Outer loop goes from 1 up to number of elements
(Missing element zero)

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

Quick Sort facts

A

Recursive algorithm - Suitable for parallel processing
Memory intensive
Inefficient for sorting lists which contain lots of similar terms

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

Merge Sort

A

Divides into sorted sub lists and puts two sorted lists together to make one large sorted list
Useful if you have two sorted lists which have to be put together

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

Divide and Rule Algorithms

A

Merge sort

Quick sort

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

Explain why a class may have position variables and others do not

A

The parent class will have properties which are inherited

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

Explaining encapsulation in terms of certain class

A

Object properties would be hidden and inaccessible outside the specified class or subclass

Code within classes methods may manipulate properties of an instance of that class ie the position coordinates of that instance

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

Why classes may be inefficiently structured

A

Repetition of many lines of code ie methods and properties in multiple subclasses

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

How classes can be made more efficient

A
Create a subclass and place all common properties/methods in here
Create two new subclasses of this subclass with only their unique property
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain using object-oriented terminology how you would get Mario to change to a penguin costume

A

The change_costume method of Mario is called

17
Q

Explain how a company could use goal tracking in order to evaluate development success

A

Set sales goal
Analysis of sales figures would indicate whether it had been achieved or not
Development success determined by whether goal was met or not

18
Q

How a company can protect its interests when getting rights for work

A

Ensure it owns/ has defined use of any intellectual property rights related to artists work

19
Q

Explain how tracking information could be used by a company to influence future development

A
  • Cookies gather data about players’ profiles, games they play. Frequency of visit.
  • Analysis of this data will show which games are popular with certain age groups.
  • Business can focus on areas likely to generate income.
20
Q

Difference between GET and POST methods

A

GET is used when search criteria is displayed in browser address bar
POST is used when search criteria is not

21
Q

The value in a HTML form

A

The text displayed inside the search box eg search or enter catalogue number

22
Q

The name in a HTML form

A

Eg criteria for where you enter criteria or search box for where you enter search credentials

23
Q

Describe how testing of a customer order process is integrative

A

Customer order process requires a server side script to activate the SQL instruction
used to extract the required details from the database
Two separate technologies in use means integrative testing is required to ensure that they connect and communicate correctly

24
Q

Types of maintenance

A

Perfective - Carried out on an existing system to improve it
Corrective - Carried out to fix any errors which should not be contained within
Adaptive - Used when client requires software to run on environment different to the one it was built for

25
Q

Explain two ways analytics could be used to inform an online marketing campaign

A

Evaluating visitor stats from the company’s own sites/Social media sites
This enhances search engine rankings
Allows for most effective product placement points and links

  • Using social media analytics to
    Determine the most productive links to groups
    Evaluate advertising placement success
    Assess prior success of competitions/launches
26
Q

Data required to implement a stack

A

1D Array
Stack Pointer/Integer variable which is used to store
the index/position of the current top value of the stack
and
Next available space

27
Q

Explain why an execution error can occur when adding an item to a stack using a 1D Array

A

Stack is full or stack overflow

An array is of a fixed size - An attempt to exceed this gives an out of range error

28
Q

Explain why an execution error would not occur on a linked list as it would on a stack

A

Linked lists do not have fixed size - They are a dynamic data structure
Items are not stored contiguously in memory, making it easier to add new items

29
Q

Explain why a bubble sort will make another pass through the list, even though it is sorted

A

A swap has taken place and so the Boolean variable will still be set to true
Terminating condition of having no swaps will not have been met until the end of the second pass

30
Q

State an error which may have occurred when swapping data

A

Name in the wrong position when scores are swapped because algorithm does not swap names also