Author |
Topic: Stack Designing (Read 698 times) |
|
gotit
Uberpuzzler
    


Gender: 
Posts: 804
|
 |
Stack Designing
« on: Oct 9th, 2007, 3:23pm » |
Quote Modify
|
How will you design a stack so that the push(),pop() and extractMin() operations are performed in constant time?
|
|
IP Logged |
All signatures are false.
|
|
|
TenaliRaman
Uberpuzzler
    
 I am no special. I am only passionately curious.
Gender: 
Posts: 1001
|
 |
Re: Stack Designing
« Reply #1 on: Oct 9th, 2007, 7:20pm » |
Quote Modify
|
Reply number 23 to 30 (roughly) here. -- AI
|
|
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
GowriKumar
Junior Member
 


Gender: 
Posts: 55
|
 |
Re: Stack Designing
« Reply #2 on: Oct 24th, 2007, 11:04am » |
Quote Modify
|
on Oct 9th, 2007, 3:23pm, gotit wrote:How will you design a stack so that the push(),pop() and extractMin() operations are performed in constant time? |
| Let's make the question a bit more interesting. Add one more operation, DeleteMin also. Can we still perform all the operations in O(1) time? Regards, Gowri Kumar
|
|
IP Logged |
www.gowrikumar.com
|
|
|
|