Q-> Design a data structure that can have operations like addition deletion
working at any end but not in middle.

Ans-> I was thinking of a circular doubly linked list and using head and
tail for operation on both sides.
or a two way stack, i.e. maintaining two counters for working on stack one
from top to bottom and another through bottom to top..
ex : top1=0, top2=n-1 where n is size of stack.
and use top1 to insert elements to index 0..1..2...
and top2 to insert elements to index n-1..n-2..n-3



-- 
Abhishek Gupta
MCA
NIT Calicut
Kerela

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