Linked Stack Time Complexity In Java