Write a C program to sort a stack in ascending order.
1,011 views
Skip to first unread message
vijay
unread,
Jul 17, 2010, 9:28:27 AM7/17/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Programming Puzzles
Write a C program to sort a stack in ascending order. You should not
make any assumptions about how the stack is implemented. The following
are the only
functions that should be used to write this program:
Push | Pop | Top | IsEmpty | IsFull
The algorithm is O(N^2) and appears below.
Do we have any other better solution which is less than O(n * n) ?