simply nbNodes
will act as "whose turn is this" for example, if the list is empty, then nbNodes equals zero, means the element that should come next is zero, if the nbNodes equals five, then the next element should be five and so on.
(例如,如果列表为空,则nbNodes
会简单地充当“此轮到谁”,那么nbNodes等于零,意味着下一步应该是零,如果nbNodes等于五,那么下一个元素应该是五,因此上。)
so the process is to check in the append method if the coming number equals nbNodes
or not and act based on that.
(因此,该过程将检查append方法中即将出现的数字是否等于nbNodes
并根据该数字进行操作。)
you may consider changing it's name to suite it's responsibility now, or add a new one for this task.
(您可以考虑立即更改其名称以适合其职责,或为此任务添加一个新名称。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…