Write a recursive method named countbelowthreshold that


Suppose you have a singly-linked list of Node objects with double data elements. The Node class is provided below.

class Node {

double data;

Node next;

}

Consider that head is the reference variable that holds the starting node of the linked list you have.

Obviously, head is an instance of the Node class.

(a) Write a recursive method named countBelowThreshold that counts the number of items in the linked list whose data value is smaller than a provided threshold.

public int countBelowThreshold(Node head, double threshold) { }

(b). What is the time complexity (big-oh) of the countBelowThreshold method you have written?

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a recursive method named countbelowthreshold that
Reference No:- TGS02936832

Expected delivery within 24 Hours