C++. Write a function to return locations(position in the list)of every node in a linked list that has a value <= x. x is anint value passed as parameter to the function.
/**Precondition: head_ptr is pointing to the head of a non-emptylinked list. x is the int **value that is passed to the functionfor lookup.
**Postcondition: the function returns an array (you can usevectors) containing locations of every node that has a value<=x. **/ vector node_positions(node *head_ptr, cons int x)
{ // code goes here }
Clearly comment your assumptions for your functionimplementations. Provide test case to show that code works. Pleaseuse the bintree.h
PayPal Gateway not configured
PayPal Gateway not configured