FAL 大經(jīng)典訓(xùn)練營(yíng)套餐(全線(xiàn)條+反欺詐+模型訓(xùn)練營(yíng)+策略提升班+小微金融全流程+數(shù)據(jù)分
2022-11-04 15:02 作者:三國(guó)盡歸許佳琪 | 我要投稿
? ?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!");
? ? ? ?}
? ?}
標(biāo)簽: