front/back insertions, front/value deletions and calculation of number of nodes