Function to check if pair with given product exists in the list Takes head pointer of the linked list and product
static bool check_pair_product ( Node head , int prod ) { List < int > s = new List < int > ( ) ; Node p = head ; while ( p != null ) { int curr = p . data ;