Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sort?" Watch "Sort?" New topic
Author

Sort?

CP Lau
Greenhorn

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:

Regards,
Manfred
 
 
subject: Sort?
 
Similar Threads
sort different file length records
WA #1.....word association
Collections.binarySearch() problem
Java Comm API... Please respond
New Session Created Randomly in Tomcat 5.0.28