Fill in the BOLD ?n? marks.The generic Link class allows for the creation of lin
ID: 3770561 • Letter: F
Question
Fill in the BOLD ?n? marks.The generic Link class allows for the creation of linked lists for any type. The linked list is made up of a series of Link objects. The first Link object is a dummy node to stand for the head of the list. The elements are stored in the following Links. A simple class for linked lists. The first Link object is a dummy node to represent the head of the list. The elements of the list are kept in the following nodes. public class Link{ private ?11? value; private ?12? next; Add val to the end of the list using recursion. @param val the value to be added to the list public void add(?13? val) { if (next == null) { next = ?14? ?15?(); next.value = ?16?; } else { next.?17?(val); } } Check if val is in the the list using recursion. Assumes the value in this link has already been checked. so it checks the value in the next link @param val the value to test for @return true if value is in the list public boolean contains(?13? val) { if (next == nullExplanation / Answer
11. T
12. Node<T>
13. T
14,15 new Node<T> (value, null);
16 val
17 add
18 value
19 value
20 contains
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.