Two pairs of integers (a, b) and (c, d) are said to be symmetric if b = c and a = d. For example, given an array of pairs { {31, 57}, {80, 90}, {25, 70}, {90, 80}, {70, 25}, {11, 20}, {10, 5}, {30, 40} }, the symmetric pairs are:
{80, 90} and {90, 80}
{25, 70} and {70, 25}
Design a hash table-based algorithm of time complexity ϴ(n) to identify the symmetric pairs in an array of 'n' pairs.
Show the working of your algorithm for the above array of pairs with a hash function H(K) = K mod 7.
What would this be