ComputerThree Sum
A SelectSmart.com Flowchart by kspiller
To print this page, right mouse click, open "Print preview", "Print" or a similar option depending on your browser, then use the controls to size this page appropriately. Go to SelectSmart.com/flowchart/flowchart.php?id=1001032 for the original version of this flowchart. Find and create other free decision making tools at SelectSmart.com. Use our interactive selectors to find the best college, best career, right religion, most appropriate dog breed, best college major and more.  
SelectSmart.com SelectSmart.com®
Make Your Own Flowchart
© SelectSmart.com. All Rights Reserved.
Provided a 1D array of integers, find all combinations of 3 values from this set such that a+b+c=0

               
Does the combination i+j+k equal zero?
YES
Place vector i j k into s. Was that the last i j k combination?
YES
Is the front array element less than the back array element?
YES
Test the next array element
Put the rows in the ss vector

NO

NO



NO

NO



YES
Test a new combination for i+j+k
 
Swap the two elements. Was that the last element of the last row?
YES
Are the two columns of the same row the same?
NO
Then the rows are not equivalent! Is that the last row in the vector?







YES


NO
 
 
Test the next column
NO
Is it the last column of the row?
Test the next two rows







YES


 
 
 
The rows are equivalent! Do not print one of the rows in ss