Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sort?

 
CP Lau
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would you sort a sequence of numbers using a stack?
This is an assignment
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic