My name is Okan and I'm a student of Computer Engineer. You can find me on .
This is a algorithm that finds smallest prime number from input numbers. You can give numbers into the algorithm and algorithm takes to pieces numbers to smallest prime number. When prime numbers are equal, algorithm compares between input numbers.
First, user enter an input that indicates how many number will be given into the algorithm. The algorithm needs double array because it must keeps input numbers and their prime numbers so that user gave size of array and each index have 2 number(first index input, other prime number)(Example: first index is {24,2})
Then, user give numbers into the algorithm for finding and sorting. Input numbers are given into the array.
After giving numbers, the algorithm finds prime numbers of each numbers and puts prime numebrs into the second index.
Final part is comparing and sorting. The algorithm compares two prime numbers and puts smaller number in front of higher number. If prime numbers are equal, the algorithm compares numbers which are in first index and sorts these numbers.