DLL (Solving Question)
DLL (Solving Question)
⑧
~
ple
itex10
-
head Her 2
=
- -
has Next has Next
(true) (true)
Hert, next- 18
-
10 iterz. next =
-
equal
ple
not
iteyist 4,01 -
= 1901 =(0) =
10 10
=
& equal
y 15=
If(X =
= y) 15 30
+
=):/2
-
sto
-N
Her null
:E)
13//
38 as
=
a
↳ is
↳mini
↳ :dant
=):=
n
re
I
:
88 50 To 1038 20
-metinued
fireisdie eine
->
-
flyinga I
::
20
->
=:: (l)=
30
38
:41)
10 70 5888
70
Output
10 30 20
↳" :(1)
80 so 10 30
E
20
80 So 70 1030 20
78 so 8o
2038 10 70 so 80
38
80 So 1830 20
⑧
↳
⑩
list. add (0)
↓
⑭nead
N::e2
=>
cer
):
-
X
: ::
X
⑳ E
27.2 = = 1 No 3%2 = 1yes
=
Her. Set (3 1 +
4)
=
: e2
-
42 18
-
System. out.
Printin ("Listis Empty");
else E
Node(z) b tail;
=
E item 1 item 2;
item 1 f. data,
=
item 2 b. data;
=
f.data_item 2;
b. data-item 1,
f f.=
next;
b boprev;333
=
-
Search
&
befor item.
item if add node
to und
&true
list
1 with Iterator 1) listiterator
without
if (head null) ==
If (head==null) return false;
return false; Node (1) ptr-head;
List Iterator (2) iter= list Iterator(); Node(E) newNode new Node
=
(item 1);
Ex ;
boolean found:
false;
While (iter. has Next()) 2
X iter,
=
next ();
While (ptr!=null 8x! found)
if (X. equals (item)) If (ptrdata = item)
=
E found =
true;
int iter. next Index();
y
=
else
/Ifnode be added
to
before the firstnode
f(y -
z (0)2 ptr ptr.next; 3
=
return true;
33// end for while
New Noch, next
return false;3 ptr;
=
New Node.prev=ptroprev;
proper new Nole;3
-
Sizett;
return true;3
return false; 3
check
head:
tail
head, next:
tail, previous
↳half half
1with
list iterator 1/ withoutdistiteratur
E E
List Iterator listIterator (0):
fptr head;
(t) nextIter
Node (E)
=
return false;
count 1+i
else?
If (ba. equals(b))
return false;3 fptr fptr.next();
=