An open API service indexing awesome lists of open source software.

https://github.com/ruferdz/sum-of-three-algorithm


https://github.com/ruferdz/sum-of-three-algorithm

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# Sum-of-Three-Algorithm
An IntelliJ project

This is a Algorithm Where all combinations of 3 numbers from a list of numbers, ranging -50 to +50 (in multiples of 5), is to added together to give a sum of 0.
The output will be the number of combinations that gave a sum of 0.



Note: The "SumOfThree.py" Python file is there to help you easily generate a number list, of any length (between -50 and 50 in multiples of 5)
, and write it to a text file.





  1. SumOfThree


    This is a program where the number list is loaded from a text file "SumOfThree.txt" to an ArrayList and the Sum of three Algorithms is run upon them





  2. SumOfThree_v2


    This is a program where the number list is loaded from a text file "SumOfThree.txt" to an ArrayList, where the ArrayList is then converted to an Array, and the Sum of three Algorithms is run upon them





  3. SumOfThree_v3


    In this case the numbers are hard-coded into a Array at the beginning itself, and so it uses this array to Sum of Three Algorithm



![](image/table.png)
![](image/graph.png)