• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stacks Need Help

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Say if i have created two different stacks,and any integer over 10 goes in one stack(bigStack). If less than 10 goes in one stack(theStack). The program is already working where it will resize if its full,but I am trying to put the integers in the right Stack. This is what I have so far.


[ Jess added UBB [code] tags to preserve whitespace, check 'em out! ]
[ September 23, 2003: Message edited by: Jessica Sant ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,
I find it really hard to believe that you could understand the program above, but still need to ask this question. It's important to take the time to read and understand code the code you're working with; you're not going to learn anything otherwise.
That said, in a loop near the end of the program, you're reading each line, parseInt()-ing it, and pushing it onto a stack. All you need to do is use an "if" statement to choose between the two stacks -- i.e., "if (next < 10) ... else ..."
[ September 22, 2003: Message edited by: Ernest Friedman-Hill ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic