


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



"
. '/ . 012 3/ 012
. '/3 2 ') - . 4 - $
%
3/3 2 3 )
/' 2 00. 11)%
- . 4 - $
- . 4 . - ' 5
&
/3 2 00 11' 012
$ !/3 2 00. 11)%
- $
- - $
(
@
' ' $, ' - <= / <"= 2 <=/ <>= 2 <=<=?/ <"=<= 2
?
A
?<=/?<= 2
>
, ' 3 ! ' -
?<=/?<= 2
?
public IntList reverse(IntList l) { IntList prev = null; IntList next = l.tail; while (l != null) { next = l.tail; l.tail = prev; prev = l; l = next; } return prev; //once we are done reversing all the pointers //we need to set l's head to the new head }
A
M0011/F,01- ' ! > $' '
L/,01L/01,N/> , ,8M Ω0011/F,01- ' ! >$' ' L/01L/,01,N/>
>
' ' $ 08M' 4 8 M 4 8I' 1, ' +
,0 /)2L?2OO1F ,0 7 />27L?27OO1F BB 01 ' H H - 0?8)10?10
E,$ ' ' 4 P $ ' ' ' 3
Q K ; J ' ! 'J ' !$ 3
, ! "; P,
"