Skip to content

Deque #1200

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

Merged
merged 2 commits into from Sep 30, 2019
Merged

Deque #1200

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions data_structures/queue/double_ended_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@
# printing modified deque
print("The deque after reversing deque is : ")
print(de)

# get right-end value and eliminate
startValue = de.pop()

print("The deque after popping value at end is : ")
print(de)

# get left-end value and eliminate
endValue = de.popleft()

print("The deque after popping value at start is : ")
print(de)

# eliminate element searched by value
de.remove(5)

print("The deque after eliminating element searched by value : ")
print(de)