Java icon indicating copy to clipboard operation
Java copied to clipboard

[FEATURE REQUEST] <Implementation of Stack using Queues>

Open IndranjanaChatterjee opened this issue 1 year ago • 10 comments

What would you like to Propose?

Hello, I would like to add the algorithm of implementation of Stack using Queues in java.

Issue details

Stack using Queues Algorithm

  1. Initialization:

    • Create two empty queues, let's call them queue1 and queue2.
  2. Push Operation:

    • To push an element into the stack, enqueue the element to queue1.
    • Now pop all the elements from queue2 until it becomes empty.
    • Swap the two queues.
    • For the next push operation queue1 becomes queue2 and vice versa.
  3. Pop Operation:

    • pop the topmost element from queue2.
  4. Top Operation:

    • Peek and return the last element from queue2.

Additional Information

I would like to add this Algorithm

IndranjanaChatterjee avatar Oct 14 '23 04:10 IndranjanaChatterjee

Hi, I am interested in implementing this. Could you provide information on which file would you want this to be in?

renurao1306 avatar Oct 14 '23 07:10 renurao1306

Hi , I am interested in implementing Could you please assign this to me

arjun-rishi-2004 avatar Oct 14 '23 08:10 arjun-rishi-2004

Hi, I am interested in implementing this. Could you please assign this to me. I have the keen background in data structure and algorithm and currently i have solved more than 1000 problems on different platforms.

nayanbirla avatar Oct 15 '23 05:10 nayanbirla

Hi, I am interested in implementing this. Could you please assign this to me. here's the sample of my work in the field : linktree

srish-03 avatar Oct 15 '23 15:10 srish-03

Hi, I am interested in implementing the above issue can you please assign it to me i'll upload the pr immediately

Venkateshsanwal avatar Oct 16 '23 16:10 Venkateshsanwal

Hi @IndranjanaChatterjee , I raised the PR for this Please check and merge it.

PankajKumarAgrawal1729 avatar Oct 17 '23 11:10 PankajKumarAgrawal1729

Hello @IndranjanaChatterjee I am interested in covering this issue. Could you please assign this to me.

aryank34 avatar Oct 19 '23 10:10 aryank34

Hey @IndranjanaChatterjee I am interested in working on this issue, as this is part of my course assignment. Can you please assign me this issue?

sricharan200 avatar Nov 12 '23 06:11 sricharan200

Let's wait for #4794

siriak avatar Nov 12 '23 09:11 siriak

what's

zt202312 avatar Dec 21 '23 08:12 zt202312

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!

github-actions[bot] avatar Jan 21 '24 00:01 github-actions[bot]

Please reopen this issue once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!

github-actions[bot] avatar Jan 29 '24 00:01 github-actions[bot]