Skip to content

Commit 38a2887

Browse files
committed
update starter for LL and 4 spaces
1 parent 5fafef5 commit 38a2887

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

ring_buffer/ring_buffer.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1+
from doubly_linked_list import DoublyLinkedList
2+
3+
14
class RingBuffer:
2-
def __init__(self, capacity):
3-
self.capacity = capacity
4-
self.current = 0
5-
self.storage = [None]*capacity
5+
def __init__(self, capacity):
6+
self.capacity = capacity
7+
self.current = None
8+
self.storage = DoublyLinkedList()
9+
10+
def append(self, item):
11+
pass
12+
13+
def get(self):
14+
# Note: This is the only [] allowed
15+
list_buffer_contents = []
16+
17+
# TODO: Your code here
18+
19+
return list_buffer_contents
20+
21+
# ----------------Stretch Goal-------------------
22+
23+
24+
class ArrayRingBuffer:
25+
def __init__(self, capacity):
26+
pass
627

7-
def append(self, item):
8-
pass
28+
def append(self, item):
29+
pass
930

10-
def get(self):
11-
pass
31+
def get(self):
32+
pass

0 commit comments

Comments
 (0)