File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Sort? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sort?" Watch "Sort?" New topic


CP Lau

Joined: Apr 05, 2001
Posts: 3
How would you sort a sequence of numbers using a stack?
This is an assignment
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi CP,
Just off the top of my head, I would probably use two stacks; s1 and s2. It probably would look something like this:

I agree. Here's the link:
subject: Sort?
Similar Threads
Collections.binarySearch() problem
New Session Created Randomly in Tomcat 5.0.28
WA #1.....word association
Java Comm API... Please respond
sort different file length records