-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
linked-list: Implemented new exercise #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'll take a deeper look at it tonight, but these were my notes looking at the problem. Notes regarding problem as a whole
Notes regarding your implementation
Extra Credit IdeasWhat I think would be very cool to do for this problem is to have users implement a couple magic methods like for x in my_deque:
do_something(x) It would also work with built ins: iterator = iter(my_deque)
first = next(iterator)
second = next(iterator) It could also be interesting to make them implement my_deque = Deque()
my_deque.push(1)
my_deque.push(2)
size = len(my_deque)
assert size == 2 Some other magic methods to consider are |
Comments regarding the problem as a whole
Comments regarding my implementation
Comments regarding your extra credit ideasI really like your idea. We could totally make this about the magic methods, by providing already the method signatures for the magic methods (we can't put them in the readme) and maybe push/pop implementation. |
Comments regarding the problem as a whole
Comments regarding my implementation
Comments regarding your extra credit ideas@kytrinyx Do you have an idea how we might be able to do this in the system currently? |
Sorry, I'm been traveling and dropped offline for a couple of days. Yeah, I think we should fix the README, and then adjust any implementations that need it based on the more accurate and useful README. For the extra credit stuff, we've just been putting it with pending tests and a comment saying extra credit. What I'd really like to do is have a file that can be included into the README on a per-exercise basis, so that we could describe the extra credit and have it just show up as a part of the problem description. |
I implemented the x-common/linked-list exercise (README.md). While Python has a
collections.deque
since 2.4 I still think you could learn a lot from implementing this.I added a skeleton file that already has a
class Node
to help starting in the right direction.