FAL 大经典训练营套餐(全线条+反欺诈+模型训练营+策略提升班+小微金融全流程+数据分
public int getLength() {
return length;
}
public int getLengthByTraverse() {
int len = 0;
ListNode currentNode = head;
while (currentNode != null) {
len++;
currentNode = currentNode.next;
}
return len;
}
private void checkIndexRange(int index) {
if (index < 0 || index >= length) {
throw new RuntimeException("The index is invalid!");
}
}