data-structures-algorithms
data-structures-algorithms copied to clipboard
Problems in data structures and algorithms.
File: linked_list/p2.py Fixes: https://github.com/kojino/data-structures-algorithms/issues/5 When testing with a linked list like: 8 12 13 8 7 13 13 11 I got a linked list that still contains duplicates. With this...
In this deletion case, the node to be deleted is just mimicking the next node and is not actually being dereferenced, right? So instead of deleting node2, we're really just...
Should be: ``` def removeDups(self): if self.head==None: return None valsList = [] node = self.head prev = None while node!=None: if node.val in valsList: # Remove this node prev.next =...
I read your medium post and went on to the solutions and I felt there was a better way of doing it. The way I am doing this will reduce...
I am a novice in python, but I heard that not using !=none is good practice, since none is a unique thing. Instead, using is not None.
close_brackets variable not used anywhere
Hi, Found this on Medium - reminding me all about linked lists! This is great and extremely elegant. The only problem I see is where we have to reverse the...