parralel computing hacks
Hacks
AP Classroom. Provide answers and thoughts on theoretical question form college board Video in section 4.3. They start at about the 9 minute mark.
- Example 1
the answer to this question is 50 seconds because the longest process in the list is 50 seconds. if you add up the other two, you will take 40 seconds. still not enough to beat 50 seconds.
- Example 2
running both process one after another will take 70 seconds but running them in parallel computing, it could take less than 25 seconds
Data Structures. Build a List Comprehension example
- list = [calc(item) for item in items]
strings = ["apple", "samsung", "google", "pineapple"]
string_lengths = [len(string) for string in strings]
print(string_lengths)
output:
[5, 7, 6, 9]