Skip to content

implemented queue - #13

Open
codesankalp wants to merge 5 commits into
masterfrom
queue
Open

implemented queue#13
codesankalp wants to merge 5 commits into
masterfrom
queue

Conversation

@codesankalp

Copy link
Copy Markdown
Owner

close #3
added methods like enqueue and dequeue and much more.

tests:-
image

@devkapilbansal devkapilbansal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add single line comments to explain your code

Comment thread dsalgo/pyqueue.py
def __init__(self, value):
self.value = value
self.next = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this extra line?

Comment thread dsalgo/pyqueue.py Outdated
if self.head is None:
self.head = new_node
self.tail = self.head
else:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 4 spaces or single tab for indentation.

Comment thread dsalgo/pyqueue.py Outdated
self.num_elements += 1

def dequeue(self):
if self.is_empty():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add what this function is doing so that other contributors don't found it difficult

close #3
added methods like enqueue and dequeue and much more.
shivsubh and others added 2 commits October 2, 2020 17:03
Added unit tests for the pyqueue in tests/queue_tests.py

changes done:

- [x] write tests for pyqueue in `tests/`.
- [x] updated the pyqueue in dsalgo.
- [x] updated the queue branch with the master.

closes #61
[Test] Added tests for queue #61
Comment thread tests/queue_tests.py
Comment on lines +42 to +44

if __name__ == '__main__':
unittest.main()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this driver code

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iske liye bhi issue banata hu me.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just remove this. I have made changes in others

dennis-pg and others added 2 commits November 7, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Queue

4 participants