How bout I say, the insertion and deletion functions have the following
prototype?

void enqueue(NODEPTR q, int data)
int deque(NODEPTR q)

You are not allowed to maintain two pointers, i.e. no front and no rare
pointers...


Regards,
Sandeep Jain
Member of Technical Staff, Adobe Systems, India




On Mon, Jul 4, 2011 at 10:20 PM, surender sanke <[email protected]> wrote:

> always maintain front and rear pointers, updating them accordingly during
> insertion and deletion can achieve this in O(1)
>
> surender
>
>
> On Mon, Jul 4, 2011 at 9:59 PM, vaibhav shukla <[email protected]>wrote:
>
>> How to implement a QUEUE using a singly link list such that the operations
>> ENQUEUE and DEQUEUE takes O(1) time ?
>>
>> --
>>   best wishes!!
>> Vaibhav Shukla
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to