Function to check if pair with given product exists in the list Takes head pointer of the linked list and product
function check_pair_product ( head , prod ) { var s = [ ] ; var p = head ; while ( p != null ) { var curr = p . data ;