Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:13:52+00:00 2026-05-27T01:13:52+00:00

What are the conventions to display a Stack and a Queue on a console

  • 0

What are the conventions to display a Stack and a Queue on a console screen?
For Example, if I am in the following situation:

    Stack<String> s = new Stack<String>();
    s.push("Hello");
    s.push("there");

So when I print the Stack, should Hello come before there or vice versa?

Same goes in the case of a Queue.

Keep in mind I'm working on a console screen and not an applet window

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:13:53+00:00Added an answer on May 27, 2026 at 1:13 am

    There are no strong conventions on how to write a stack to the screen.
    The only convention is that the last item pushed to a stack is normally called the “top” of the stack. If you are writing the elements vertically, write the most recently pushed item at the top. (It should be said that even that convention is not universal).

    For a queue there isn’t even that convention. Do whatever seems like a good idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there conventions for function names when using the Perl Test::More or Test::Simple modules?
There are two popular naming conventions: vc90/win64/debug/foo.dll foo-vc90-win64-debug.dll Please discuss the problems/benefits associated with
What conventions (if any) do you use for indenting XSL code? how do you
What are the best conventions of naming testing-assemblies in .NET (or any other language
What are the naming conventions that you use while coding?
Are the naming conventions similar in different languages? If not, what are the differences?
Most C++ naming conventions dictate the use of camelCaseIdentifiers : names that start with
I'm curious about conventions for type-punning pointers/arrays in C++. Here's the use case I
What are some good conventions to follow if I want to make my application
What naming conventions are you using for namespaces and sponsor classes? (i.e. the classes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.