what do you mean by sorting elements in stack  ? A stack is a data structure
in which the relative position of elements depend on their order of
insertion.

If we sort elements in stack, how does it retain the property of a stack ?

If we really want that property, we will have O(n) rather than O(1) insert
and maintain two pointers. Stack next and sorted next.

On Sun, Jun 13, 2010 at 1:05 PM, jalaj jaiswal <[email protected]>wrote:

> how to sort elements of stack using constant space
>
> --
> With Regards,
> Jalaj Jaiswal
> +919026283397
> B.TECH IT
> IIIT ALLAHABAD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to