Lists are native to python, list are not fixed sized, list can use for each loops
True or False: Arrays are native to python
False
Name one thing tuples can be used for
Store data, multiple return types, tuple unpacking, thread safety (don't worry about this one)
Name the four sorting algorithms we have learned so far
Bubble sort, merge sort, quick sort, insertion sort
What is software engineering
The practice of applying software design principles, as well as software processes, to create software that is more maintainable, scalable, and higher quality in less time.
I will also except a better version of CS
True or False: Lists can be mutated
True
True or False: Arrays can be mutated
True
True or False: Tuples can be mutated
False
Which of the sorting algorithms that we have learned about so far is the fastest on average
Quick sort
Name one design pattern
What is the time complexity of removing from the end of a list
O(1) or O(C)
Name an example of something that would be better suited to be an array than a list
Anything that you know is fixed size, for example a tic-tac-toe board or a list of numbers that can only ever represent one byte
Are tuples fixed size
Yes
What is the best case time complexity of merge sort
O(Nlog(N))
Name one design anti-pattern
Blob, copy and paste coding, lava code, golden hammer, etc.
What is the time complexity of removing from the first index of a list and why.
O(N), because all elements need to be shifted over 1
Name on advantage of arrays being fixed size
Time complexity, when something is fixed size you never need to reallocate all of the memory due to running out of continuous memory in the original location
Name of example of something that would be better suited as a tuple rather than a list or array
Anything that would never change like coordinates
What is the worst case time complexity for quick sort and what scenario does it occur
O(N^2), when the list is sorted or reverse sorted
Say you are design a system that allows users to create virtual running groups. The system needs to notify all other users when one user begins working out, (which is detects based on movement speed). What design pattern would you use
Observer
What is difference between a_list = a_list + [5] and a_list += [5]
+= will alter the memory of the list add thus change the reference, whereas + will create a new copy that does not change the reference, only the copy
They are not iterable
According to python programmer tuples should be used when you are storing what type of data
Homogeneous
What is the main advantage that you get from using a hybrid sort
Better time complexity
What does the acronym SOLID stand for
Single responsibility, Open/Closed, Liscov Substitution, Interface Segregation, Dependency Inversion