Finding three elements with zero sum in an array.
Given an array of positive and negative numbers, how do we write a program to check if it has three elements with sum 0. For example, the array {-31, 19, -6, -45, 12, -8, 3, -77, 56, 29} contains {-31,12,19} with sum zero. One obvious solution is to examine each possible triplet of the array…