Closed Arvind-raj06 closed 3 years ago
Merging #321 (b2e588c) into master (09b338c) will decrease coverage by
0.271%
. The diff coverage is86.764%
.
@@ Coverage Diff @@
## master #321 +/- ##
=============================================
- Coverage 98.828% 98.557% -0.272%
=============================================
Files 25 25
Lines 3073 3119 +46
=============================================
+ Hits 3037 3074 +37
- Misses 36 45 +9
Impacted Files | Coverage Δ | |
---|---|---|
...datastructs/miscellaneous_data_structures/queue.py | 95.982% <86.764%> (-4.018%) |
:arrow_down: |
What's the difference between queue or doubly-ended queue other than the difference in end points for adding or removing elements?
It can work like a stack and doubly linked list if used in a way but the queue's cannot
I have implemented it only for array and yet to be in linked list....
In other words, can we make queue doubly ended? Do we need an extra class like, Deque
? Can we just simply add methods like, appendleft
and popleft
to queue class? What will be the disadvantages of adapting such approaches?
But as per people's knowledge the queue will always insert at end and remove at front but deque will have insert and delete at both sides, that's the reason they call it double ended queue.
What about adding an extra argument, double_ended
in the constructor of queue? If it is True
, only then, appendleft
and popright
will work, otherwise these both will raise error.
Yeah that can work too
But I need to reframe the rear pointer to work for both double ended queue and regular queue if that's ok I will proceed doing changes with commit.
You can try changes with queue. But do not delete ArrayDeque in your work branch for this PR in case we don't go with changes in queue.
Cool I will complete it right away and show it you
@czgdp1807 Now will this work!?
You can remove the Deque class.
You can remove the Deque class.
Yes
@czgdp1807 Done
Please make similar changes for LinkedListQueue
and remaining implementations of queues.
Please make similar changes for
LinkedListQueue
and remaining implementations of queues.
Yeah sure
@czgdp1807 I have a doubt in implementing the above in priority queue what should I name the operation as but in wikipedia it's given as https://en.wikipedia.org/wiki/Double-ended_priority_queue#Operations
PriorityQueue
isn' t a queue
as far as I remember. The double ended property should only be added to the sub classes of Queue
.
@czgdp1807 I did some improvements on suffix tree, it's working quite fine and shall I make the PR after this or now!
it's working quite fine and shall I make the PR after this or now!
Sure.
it's working quite fine and shall I make the PR after this or now!
Sure.
Yeah
Array Deque
References to other Issues or PRs or Relevant literature
"Fixes #120". See https://github.com/codezonediitj/pydatastructs/issues/120
Brief description of what is fixed or changed
Added Array deque with DODA and created a abstract class for Deque
Other comments
Hope this code works fine and if there is any issue ping me, yes this PR also included the SWOC participation