FAL 全面組合訓(xùn)練營
? ? } else {
? ? ? ? ? ? ? ?if (currentNode.val == value) {
? ? ? ? ? ? ? ? ? ?prevNode.next = nextNode;
? ? ? ? ? ? ? ? ? ?currentNode.next = null;
? ? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ? ? ?prevNode = currentNode;
? ? ? ? ? ? ? ?}
? ? ? ? ? ?}
? ? ? ? ? ?currentNode = nextNode;
? ? ? ?}
? ?}
? ?public int getLength() {
? ? ? ?return length;
? ?}
? ?public int getLengthByTraverse() {
? ? ? ?int len = 0;
? ? ? ?ListNode currentNode = head;
? ? ? ?while (currentNode != null) {
標簽: