@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
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
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
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
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
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
>
>
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