Web Analytics
Algorithm for insertion in doubly ended queue