Font size
WorksheetsALGO - Lesson 4 (Data Structure)
Total questions: 28
Worksheet time: 15mins
Organization of data to be used efficiently.
Data Structure
Data Storage
Data Organization
Amount of time an algorithm takes to run
(as the size of the problem/input increases).
Time Complexity
Space Complexity
Amount of memory an algorithm uses
(as the size of the problem/input increases).
Time Complexity
Space Complexity
Focuses on the speed of an algorithm.
Time Complexity
Space Complexity
Focuses on the memory usage of an algorithm.
Time Complexity
Space Complexity
How big the instruction is.
Time Complexity
Space Complexity
BUT, in an ideal algo, ____________ is the only variable to be focused on.
Time Complexity
Space Complexity
WHY? In an ideal algo, time complexity is the only variable to be focused on.
- Because in an ideal world, we want our algorithms to be ___________, so focusing on time complexity makes sense.
as fast as possible
as slow as possible
as efficient as possible
as helpful as possible
WHY? In an ideal algo, time complexity is the only variable to be focused on.
- An algorithm that runs faster is often seen as more "_______", even if it uses more memory.
efficient
slower
helpful
WHY? In an ideal algo, time complexity is the only variable to be focused on.
- An algorithm with a __________ is often preferred, even if it has a __________________.
lower time complexity, higher space complexity
higher time complexity, lower space complexity
lower space complexity, higher time complexity
higher space complexity, lower time complexity
it is the only variable that directly affects the performance (and efficiency) of the algorithm.
Time Complexity
Space Complexity
WHY? In an ideal algo, time complexity is the only variable to be focused on.
- Algorithms with _________ time complexity tend to ______ better as input sizes increase.
lower
higher
scale
shrink
WHY? In an ideal algo, time complexity is the only variable to be focused on.
- Algorithms with _________ time complexity tend to ______ better as input sizes increase.
lower
higher
scale
shrink
Problem: You want to insert an element in the first position in array.
Solution: __________________
Conclusion: ___________ is faster to array in this scenario. All other solutions can be revisited upon recalculating the time complexity of this problem.
Linked List
Dictionary
Trees
Graphs
Running time depends on how small your input is.
True
False
Example 1:
f(n) = 5n^2 + 6n + 12
n = 1
Get the percentage (%) of the running time for the first term:
21.74%
26.09%
52.17%
Example 1:
f(n) = 5n^2 + 6n + 12
n = 1
Get the percentage (%) of the running time for the second term:
21.74%
26.09%
52.17%
Example 1:
f(n) = 5n^2 + 6n + 12
n = 1
Get the percentage (%) of the running time for the third term:
21.74%
26.09%
52.17%
Example 1:
f(n) = 5n^2 + 6n + 12
n = 1
To check: 21.74% + 26.09% + 52.17% = 100%
True
False
Example 2:
f(n) = 5n^2 + 6n + 12
n = 10
Get the percentage (%) of the running time for the first term:
87.41%
10.49%
2.10%
Example 2:
f(n) = 5n^2 + 6n + 12
n = 10
Get the percentage (%) of the running time for the second term:
87.41%
10.49%
2.10%
Example 2:
f(n) = 5n^2 + 6n + 12
n = 10
Get the percentage (%) of the running time for the third term:
87.41%
10.49%
2.10%
Example 2:
f(n) = 5n^2 + 6n + 12
n = 10
Numerator: 500 + 60 + 12 = 572
True
False
Example 2:
f(n) = 5n^2 + 6n + 12
n = 10
To check: 87.41% + 10.49% + 2.10% = 100%
True
False
Is this is the proper way of showing growth rate?
True
False
How do you draw a conclusion for this quadratic equation:
5n^2+6+12
Conclusion: _____________________________________________________, I can say/conclude that the runtime for 5n^2 and 6n is heavier as the value of n increases and the runtime of 12 decreases as the value of n increases.
Based on my computations of the quadratic equation of 5n^2+6+12 with the f(n) with n=1 and n=10
Based on my notes of the quadratic equation of 5n^2+6+12 with the f(n) with n=1 and n=11
Based on my answers of the quadratic equation of 5n^2+6+12 with the f(n) with n=2 and n=10
Based on my analysis of the quadratic equation of 5n^2+6+12 with the f(n) with n=1 and n=100
How do you draw a conclusion for this quadratic equation:
5n^2+6+12
Conclusion: Based on my computations of the quadratic equation of 5n^2+6+12 with the f(n) with n=1 and n=10, _________________________________________ and the runtime of 12 decreases as the value of n increases.
I can say/conclude that the runtime for 5n^2 and 6n is heavier as the value of n increases
I can say/conclude that the runtime for 5n^2 and 6n is not heavier as the value of n increases
I can say/conclude that the runtime for 5n^2 and 6n is heavier as the value of n decreases
How do you draw a conclusion for this quadratic equation:
5n^2+6+12
Conclusion: Based on my computations of the quadratic equation of 5n^2+6+12 with the f(n) with n=1 and n=10, I can say/conclude that the runtime for 5n^2 and 6n is heavier as the value of n increases and _______________________________________.
the runtime of the constant value of 12 decreases as the value of n increases.
the runtime of the constant value of 12 increases as the value of n increases.
the runtime of the constant value of 12 decreases as the value of n decreases.
