{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Section6Key 3 - O n e p o s s i b l e public if solut i-on...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
,/ . One pos s ible solut i-on appears below . public void transferFrom(Linkedlntlist other) { if (front :: nul-l) front other. front; else { ListNode current front; whil-e (current . next !- nuII ) current : current.next; current. next other. front; ) other.front = nul1; ) lO. One possible sol-ution appears below. public int deleteBack ( ) { if (front nul_I) throw new IllegalStateException ( "empty l_ ist " ) ; int result : 0; if (front.next null) { result front. data; front nuLl; ) else { ListNode current front i while (current.next.next | : null-) current current. next; result current. next . data; current . next nul-l-; ) return result; ) 11. One possible solution appears below. public
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}