2017 Flashcards
Max comparisons in a binary search
Finding power of two greater than items in the list
Eg List size 5 2^3=8 so 3 is answer
No of comparisons in a linear search
N/2 (n is number of items in the list)
Linear Search facts
Simple algorithm
List may be unsorted
Number of comparisons given by n/2
Slow for large lists
Binary Search facts
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
Why selection sort two lists is inefficient
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
Comparing Binary and Linear Search
Binary search requires list to be sorted - more complex so more processor time
Linear search more efficient on smaller lists
Bubble sort facts
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
Insertion Sort number of passes
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)
Quick Sort facts
Recursive algorithm - Suitable for parallel processing
Memory intensive
Inefficient for sorting lists which contain lots of similar terms
Merge Sort
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
Divide and Rule Algorithms
Merge sort
Quick sort
Explain why a class may have position variables and others do not
The parent class will have properties which are inherited
Explaining encapsulation in terms of certain class
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
Why classes may be inefficiently structured
Repetition of many lines of code ie methods and properties in multiple subclasses
How classes can be made more efficient
Create a subclass and place all common properties/methods in here Create two new subclasses of this subclass with only their unique property
Explain using object-oriented terminology how you would get Mario to change to a penguin costume
The change_costume method of Mario is called
Explain how a company could use goal tracking in order to evaluate development success
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
How a company can protect its interests when getting rights for work
Ensure it owns/ has defined use of any intellectual property rights related to artists work
Explain how tracking information could be used by a company to influence future development
- 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.
Difference between GET and POST methods
GET is used when search criteria is displayed in browser address bar
POST is used when search criteria is not
The value in a HTML form
The text displayed inside the search box eg search or enter catalogue number
The name in a HTML form
Eg criteria for where you enter criteria or search box for where you enter search credentials
Describe how testing of a customer order process is integrative
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
Types of maintenance
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
Explain two ways analytics could be used to inform an online marketing campaign
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
Data required to implement a stack
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
Explain why an execution error can occur when adding an item to a stack using a 1D Array
Stack is full or stack overflow
An array is of a fixed size - An attempt to exceed this gives an out of range error
Explain why an execution error would not occur on a linked list as it would on a stack
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
Explain why a bubble sort will make another pass through the list, even though it is sorted
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
State an error which may have occurred when swapping data
Name in the wrong position when scores are swapped because algorithm does not swap names also