Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #107.73K
~184 People Reached
Favorite Forums
Favorite Tags
java x 1

1 Posted Topic

Member Avatar for whatsgoin'on

Use two stacks. Lets name that as addStack and removeStack. Call addStack.push() method in enequeue() and in dequeue(), check whether removeStack is empty. If it is empty, copy the elements off addStack in reverse order to removeStack and flush addStack(). So now in dequeue() invoke, removeStack.pop(). Simple.

Member Avatar for krssanthosh
0
184

The End.