wu :: forums
« wu :: forums - Stack Designing »

Welcome, Guest. Please Login or Register.
Mar 22nd, 2025, 2:38pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: Grimbal, SMQ, ThudnBlunder, william wu, Icarus, Eigenray, towr)
   Stack Designing
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Stack Designing  (Read 698 times)
gotit
Uberpuzzler
*****





   
Email

Gender: male
Posts: 804
Stack Designing  
« on: Oct 9th, 2007, 3:23pm »
Quote Quote Modify 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: male
Posts: 1001
Re: Stack Designing  
« Reply #1 on: Oct 9th, 2007, 7:20pm »
Quote Quote Modify 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
**





   
WWW Email

Gender: male
Posts: 55
Re: Stack Designing  
« Reply #2 on: Oct 24th, 2007, 11:04am »
Quote Quote Modify 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
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board