TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
58.83k stars 19.03k forks source link

[FEATURE REQUEST] <Implementation of Stack using Queues> #4789

Closed IndranjanaChatterjee closed 8 months ago

IndranjanaChatterjee commented 11 months ago

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

renurao1306 commented 11 months ago

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

arjun-rishi-2004 commented 11 months ago

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

nayanbirla commented 11 months ago

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.

srish-03 commented 11 months ago

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

Venkateshsanwal commented 11 months ago

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

PankajKumarAgrawal1729 commented 11 months ago

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

aryank34 commented 11 months ago

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

sricharan200 commented 10 months ago

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?

siriak commented 10 months ago

Let's wait for #4794

zt202312 commented 9 months ago

what's

github-actions[bot] commented 8 months ago

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] commented 8 months ago

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!