We have a problem at singly_linked_list.py at append method:
When we design the append we think of using it with append at the beginning and append at the end
Problem:
When we append at end of list it seems that they are duplicating the element at the beginning of the list.
In [2]: from pydsx import SinglyLinkedList
In [3]: l = SinglyLinkedList()
In [4]: l.append(1)
In [8]: l.append(2,tail=True)
In [11]: print(len(l))
for i in l:
...: print(i)
...:
...:
>>2
>>1
>>2
And when the first entry in the list is with tail=True we have this error
Where to look
pydsx.singly_linked_list.linked_list.py
def append(self, value, first=True, tail=False):
if value is None:
return None
if first and not tail:
self._append_first(value)
if tail:
self._append_tail(value)
Remember try to write test:
tests.test_linked_list.py
We have a problem at singly_linked_list.py at append method:
When we design the append we think of using it with append at the beginning and append at the end
Problem: When we append at end of list it seems that they are duplicating the element at the beginning of the list.
And when the first entry in the list is with tail=True we have this error
Where to look
pydsx.singly_linked_list.linked_list.py
Remember try to write test:
tests.test_linked_list.py