The best way to do the size is probably to maintain a size variable your self and increment it upon a call to add or decrement it upon a call to remove and then all you need to do is return the value...