Unit 1 Flashcards
List the 5 Data Processing Functions
Sorting, Conversion, Analysis, Reporting, Aggregation
List the 4 traits of good data
Reliable - Same data gives same results
Economical - Is not expensive to collect
Flexible - Can be used in all relevant circumstances
Relevant - Fit for purpose
List the 4 parts of the event loop, in order
Event
Trigger
Event Handler
Event Loop
How does quick sort work?
1 - Choose a pivot element.
2 - Iterate through each element.
3 - Each element less than the pivot element is placed in one sub-list, and all elements greater than the pivot element are placed in another.
4 - Repeat steps 2/3 on each sublist, until all the sublists have a length of one.
5 - Merge all the sublists.
What are the pros and cons of quick sort?
Pros:
- Since the list is split, no more storage is needed.
- Fast with large lists
Cons:
- Worst case performance is similar to bubble/insertion
How does insertion sort work?
Iterate through each element, compare to element before it. If smaller, compare to next etc until you find the right place to put it.
What are the pros and cons of insertion sort?
Pros:
- Simple to write
- Sorts in-place so minimum memory requirements
Cons:
- Poor performance, performs badly with large datasets
How does bubble sort work?
Iterate through each element, if the next element is smaller, swap them. Keep iterating through the dataset until no changes are made.
What are the pros and cons of bubble sort?
Pros:
- Simple to write
- Easy to understand
- Sorted in place so little memory overhead
Cons:
- Not very efficient, time to process increases exponentially as data set size increases
Properties of a tuple
- Ordered
- Indexable
- Immutable
- Static
- Duplicate elements are allowed
Properties of a set
- Unordered
- Immutable
- Dynamic
- Non-indexed
- Duplicate elements are not allowed
Properties of a dictionary
- Unordered
- Dynamic
- Mutable
- Duplicate keys not allowed
- Fast to search
What are the primitive data types?
- Integer
- Float/Real
- String
What is a record?
Stores related data. Implemented in Python as a dictionary inside of a dictionary.
What is polymorphism?
When code has different forms for multiple different contexts (usually with different data types) and still works.