Question Completion Status 3 points Write a cegusive method called sequence, which prints a sequence of numbers, separated by a white space, starting from the number, which is given as a parameter to the method Then the next elementing of the sequence is (-1/2) if ng is even otherwise, it is (3.1-1.1) The sequence ends with 1 void sequence(int n) 3 Example sequence(20) will print 20 10 5 16 8 4 2 1 sequence(3) will print 3 10 5 16 8 4 2 1 For the toolbar, press ALT F10 (PC) or ALT+FN+F10(Mac). Anal 140x O Question Completion Status: Assume that class Node and class SinglyLinkedList for lists of integers contains the methods which are summarized in the table below. Extend class SinglyLinkedList by writing a method removeAlloccurrencesof smallest that finds and deletes all the occurrences of the smallest element in the list. class Node int getInfo() Returns the value of info of the node. int getLink() Returns the reference of the next node. class SinglyLinkedlist void addFirst (int info) Inserts the specified element at the beginning of this list boolean contains (int info) Returns true if this list contains the specified element int getFirst() Returns the first element in this list boolean isEmpty() Remaining Time: 53 minutes, 12 seconds. Question Completion Status: Returns Une TerenCE UT UTE TEXTO class SinglyLinkedList void addFirst (int info) Inserts the specified element at the beginning of this list boolean contains (int info) Returns true if this list contains the specified element. int getFirst() Returns the first element in this list boolean isEmpty() Returns true if this list is empty int remove (int info) Removes the first occurrence of the element in this list. int size() Returns the number of elements in this list Question 5 3 points Write a racusive method, called sequence(), which prints a sequence of numbers, separated by a white space, starting from the number n which is given as a parameter to the method Then the next element ne of the sequence is (-1/2) if n, is even otherwise, it is (3.-1 + 1) The sequence ends with 1 void sequence(int n) Example sequence(20) will print 20 10 5 16 8 4 2 1 sequence(3) will print: 3 10 5 16 8 4 2 1 For the toolbar.press ALT+F10 (PC) or ALT+FN+F10 (Mac) BI V S Paragraph Arial v 14px 2 I. XO O