Demo entry 6363434

lamport

   

Submitted by anonymous on May 13, 2017 at 14:53
Language: C++. Code size: 290 Bytes.

BOOL enqueue(ELEMENT_TYPE value)
{
	if(NEXT(head) == tail)
		return FAILURE;
	buffer[head] = value;
	head = NEXT(head);
	return SUCCESS;
}

BOOL dequeue(ELEMENT_TYPE *value)
{
	if(head == tail)
		return FAILURE;
	*value = buffer[tail];
	tail = NEXT(tail);
	return SUCCESS;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).