Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Linked List Worksheet 1

star
star
star
star
star
Last updated over 2 years ago
3 Nsɛmmisa
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

What is the output?

ListNode x = new ListNode("6", new ListNode ("2", new ListNode("8", null)));

out.println(x.getValue());

out.println(x.getNext().getNext().getValue());

out.println(x.getNext().getValue());

1
Asemmisa {{asɛmmisaAhyɛnsode}}
2.

What is the output?

ListNode x = new ListNode("go", new ListNode ("on", new ListNode("at", new ListNode("up", , null ) ) ) );

out.println(x.getValue());

out.println(x.getNext().getNext().getNext().getValue());

out.println(x.getNext().getValue());

out.println(x.getNext().getNext().getValue());

1
Asemmisa {{asɛmmisaAhyɛnsode}}
3.

Fill the blanks below to print out the entire list.

ListNode z = new ListNode("go", new ListNode ("on", new ListNode("at", new ListNode("up", new ListNode("over", null ) ) ) ) );

while( *1 ) {

<*2>

<*3>

}

What should fill in <*1>?

What should fill in <*2>?

What should fill in <*3>?