In this scenario, you are given a single-linked list data structure. It contains only a reference to the head node. Each node in the list contains only a single numeric value and a reference to the next node in the list. The "next" reference in the last node contains nil value.
Given this list, examine the following problems:
1. finding an element with a given numeric value,
2. listing the cartesian product of the list with itself - i.e. list all possible pairs created from the elements of the list. The order does matter here - the pair (1,2) is distinct from the pair (2,1).
for each of these problems:
State the algorithm you would use. Write it in the form of pseudocode or actual code and explain all steps, conditions, functions' arguments and all other features used.
thank a lot!