Skip to content

Commit c66cd51

Browse files
committed
Clarify wording in README for ring buffer
1 parent 7fb4ac6 commit c66cd51

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ This Sprint Challenge is split into three parts:
3030

3131
A ring buffer is a non-growable buffer with a fixed size. When the ring buffer is full and a new element is inserted, the oldest element in the ring buffer is overwritten with the newest element. This kind of data structure is very useful for use cases such as storing logs and history information, where you typically want to store information up until it reaches a certain age, after which you don't care about it anymore and don't mind seeing it overwritten by newer data.
3232

33-
Implement this behavior in the RingBuffer class. RingBuffer has two methods, `append` and `get`. The `append` method adds elements to the buffer. The `get` method returns all of the elements in the buffer ordered from oldest to newest. In other words, least-recently added elements first, then most-recently added elements.
33+
Implement this behavior in the RingBuffer class. RingBuffer has two methods, `append` and `get`. The `append` method adds elements to the buffer. The `get` method returns all of the elements in the buffer in a list in their given order. It should not return any `None` values in the list even if they are present in the ring buffer.
3434

3535
For example:
3636

3737
```python
3838
buffer = RingBuffer(3)
3939

40+
buffer.get() # should return []
41+
4042
buffer.append('a')
4143
buffer.append('b')
4244
buffer.append('c')
@@ -70,9 +72,7 @@ Also, include the runtime and space complexities of the original code and your o
7072

7173
### Stretch Problems
7274

73-
1. Implement the other tree traversal algorithm that you didn't implement on the `BinarySearchTree` class. Run the appropriate test file to test your implementation's correctness. Then go back to the `Data_Structures_Answers.md` file and answer the time and space complexity questions pertaining to the traveral method you just implemented.
74-
75-
2. Say your code from `names.py` is to run on an embedded computer with very limited RAM. Because of this, memory is extremely constrained and you are only allowed to store names in arrays (i.e. Python lists). How would you go about optimizing the code under these conditions? Try it out and compare your solution to the original runtime. (If this solution is less efficient than your original solution, include both and label the strech solution with a comment)
75+
1. Say your code from `names.py` is to run on an embedded computer with very limited RAM. Because of this, memory is extremely constrained and you are only allowed to store names in arrays (i.e. Python lists). How would you go about optimizing the code under these conditions? Try it out and compare your solution to the original runtime. (If this solution is less efficient than your original solution, include both and label the strech solution with a comment)
7676

7777

7878
### Rubric
@@ -92,8 +92,7 @@ Also, include the runtime and space complexities of the original code and your o
9292

9393
#### Stretch
9494

95-
- Both DFS and BFS pass tests: 2 points
96-
- `names.py` is optimized with sub-quadratic runtime complexity and tightly constrained linear space complexity: 2 points
95+
- `names.py` is optimized with sub-quadratic runtime complexity and tightly constrained linear space complexity: 4 points
9796

9897

9998
#### Grading

0 commit comments

Comments
 (0)