Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread ADITYA KUMAR
@monang wats the terminating codition..?? On Fri, Jun 10, 2011 at 9:21 PM, Monang Setyawan wrote: > I think you don't need other queue to do this, simply enqueue the > non-negative dequeued element to the original queue. > > > On Fri, Jun 10, 2011 at 11:32 AM, ADITYA KUMAR > wrote: > > since a

Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread Monang Setyawan
I think you don't need other queue to do this, simply enqueue the non-negative dequeued element to the original queue. On Fri, Jun 10, 2011 at 11:32 AM, ADITYA KUMAR wrote: > since a queue is given ...only queue operations are allowed > just dequeue all elements from the queue and if a number is

Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread ADITYA KUMAR
since a queue is given ...only queue operations are allowed just dequeue all elements from the queue and if a number is +ve enqueue them to other queue after this just copy the 2nd queue to 1st one O(n) On Fri, Jun 10, 2011 at 3:44 PM, Sangeeta wrote: > write an algo that deletes all negative in

Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread Kunal Patil
Yups...that seems best.. :) On Fri, Jun 10, 2011 at 4:03 PM, sunny agrawal wrote: > initialy cal size of queue then apply a for loop > > > On Fri, Jun 10, 2011 at 4:00 PM, sunny agrawal wrote: > >> First algorithm taht comes in mind >> >> deque a element >> if +ve enque again >> if(-ve) do nothin

Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread sunny agrawal
initialy cal size of queue then apply a for loop On Fri, Jun 10, 2011 at 4:00 PM, sunny agrawal wrote: > First algorithm taht comes in mind > > deque a element > if +ve enque again > if(-ve) do nothing > > now question is terminating condition > > > On Fri, Jun 10, 2011 at 3:44 PM, Sangeeta wrot

Re: [algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread sunny agrawal
First algorithm taht comes in mind deque a element if +ve enque again if(-ve) do nothing now question is terminating condition On Fri, Jun 10, 2011 at 3:44 PM, Sangeeta wrote: > write an algo that deletes all negative integers without changing the > order of remaining elements of the queue > >

[algogeeks] write an algo that deletes all negative integers without changing the order of remaining elements of the queue

2011-06-10 Thread Sangeeta
write an algo that deletes all negative integers without changing the order of remaining elements of the 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 fro