Skip to content

Commit 341b1c5

Browse files
committed
Questions answered, sprint complete
1 parent 23d4437 commit 341b1c5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Data_Structures_Answers.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,34 @@ Add your answers to the questions below.
22

33
1. What is the runtime complexity of your ring buffer's `append` method?
44

5+
O(1)
6+
57
2. What is the space complexity of your ring buffer's `append` function?
68

9+
O(1)
10+
711
3. What is the runtime complexity of your ring buffer's `get` method?
812

13+
O(n)
14+
915
4. What is the space complexity of your ring buffer's `get` method?
1016

17+
O(n)
1118

1219
5. What is the runtime complexity of the provided code in `names.py`?
1320

21+
O(n)
22+
1423
6. What is the space complexity of the provided code in `names.py`?
1524

25+
O(2n)
26+
1627
7. What is the runtime complexity of your optimized code in `names.py`?
1728

29+
O(logn)
30+
1831
8. What is the space complexity of your optimized code in `names.py`?
32+
33+
Not sure if this counts as O(n) or O(2n). Having the two lists is a bit
34+
confusing. Final answer, O(2n)
35+

0 commit comments

Comments
 (0)