U:dASS - LO\\"ELL
);'amc: h~~ Kc:/ ----------
Student ID :
Question f Po-int ~_J
1 ~l-1 ~
-- ----l- -- '
2 - - ~ JO 1
3
·1
Ill
15
l
4
5 23
1-----
G- I lI
7 10
Tot al 1:l~
'--- .L -
hist ructions:
1. This cxa111i11a tiu n contains 13 pagf';,. incl11di11g t his pag<'.
2 \\·rile your ;111~we rs in this bookl<'l If you mus t write· 011 the hnck pa g,'. p ka:-c' i11dirnt,' Y<'I':'\" ct,,arh·
0 11the front of the pag,' that you hav<? writte n 011 the back of t he pagt' ·
3. Yu n may tbe a.uy rC':-C•lll"CC':< . including lec turC' 11,>tt' "· hooks . other srnd<'nt:- ,,r utll<'r C'nginN'r:<. but ~-,,u
' s hou ld pro\·idt· a rl'f<·rence.
,I. Yuu may u,-,f' a calnilat ur. Yuu 111a ~· 11, >t s h a r,' 3 cakulnt or with a11y,rn1' .
, Question 1·· L m
" ked Lists
l40ptsJ
(a) o(10 points)
·
ne c1rc-ularly singly linked
, ' ,,,,., 'r
!is/
PleasC' complete th £ I
o lowing function to concatenate two circular)
. . .
y smglv lmked hst into
• s tru r t node Node
3 b IIUl l node {
• int data
' Node• nc~t
};
Node•
• Pr• d c oncatcnate{Nodc• I,~ . tJ 0
J
/ ' N d c• I I sl 2) {
O UC. (• & DC\\ J
p o111 ts to i'i,t \\hH.h c-on ta1n~ J
• of li sti;. t" new list Thr. ~ro• ,~ti followcd br) I11<12 ti pointer which
nU"1C'llt'< (jqt I nn< · 2 point
,Gt H!'tlltll,r
to th,
tail " of thr.
l'\o ~ "' b=-"'p-
.tf ( Lis-\-L -=-: N JLL)
(<t ~~ V\ l\ sr i I
.
:: !'lJ.Ll)
Ll ~ -t-1 ;
2