Re: [algogeeks] Re: Min Enqueue Dequeue in O(1)

2011-06-08 Thread coder dumca
I have same problem  to implement a to implement a stack with functions
push(int)  pop   min()  and max()  in O(1)
if some one know please elaborate.

On Tue, Jun 7, 2011 at 11:13 PM, ross jagadish1...@gmail.com wrote:

 Can u pls elaborate on your approach further?

 On Jun 7, 10:17 pm, NIKHIL JAIN nikhil.jain.shali...@gmail.com
 wrote:
  it with the change that now it is min
 
  On Tue, Jun 7, 2011 at 10:47 PM, NIKHIL JAIN 
 nikhil.jain.shali...@gmail.com
 
 
 
 
 
 
 
   wrote:
   i think sliding window is based on
 
   On Tue, Jun 7, 2011 at 9:26 PM, ross jagadish1...@gmail.com wrote:
 
   Design a Queue (strictly fifo) to support findmin, enqueue, dequeue in
   o(1).
   extra space allowed.
   (for a stack, its trivial with 2 stacks) Can the same approach be
   applied for a queue?
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Min Enqueue Dequeue in O(1)

2011-06-07 Thread ross
Can u pls elaborate on your approach further?

On Jun 7, 10:17 pm, NIKHIL JAIN nikhil.jain.shali...@gmail.com
wrote:
 it with the change that now it is min

 On Tue, Jun 7, 2011 at 10:47 PM, NIKHIL JAIN nikhil.jain.shali...@gmail.com







  wrote:
  i think sliding window is based on

  On Tue, Jun 7, 2011 at 9:26 PM, ross jagadish1...@gmail.com wrote:

  Design a Queue (strictly fifo) to support findmin, enqueue, dequeue in
  o(1).
  extra space allowed.
  (for a stack, its trivial with 2 stacks) Can the same approach be
  applied for a queue?

  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.