Bubble Sort
In Number theory, Primes play a very important role. They are the keys of Code and Cryptography.
Fist time we used Primes was in the Problem of factorisation.
They can only be divided by 1 or Themselves;
That's why we call them Primes.
Primes as Locks :
As you can see in the above explanation, Primes are the builing blocks of any natural number.
For example, if we take any two large Prime numbers, say P1 = 709 and P2 = 733
their product, i.e. P1*P2 = 519697....
that was easy, we could just use a calculator for that, but ;
if I ask you to find two primes that multiply to give 519697 as a product,
then its difficult, right ?!
Well, its not your fault, there are limits to our calculation prowess and we accept it. In the case of Large Primes, Brute Force gets increasingly difficult. Here is an example of that :
As you can see Time increases exponentially as the size of input increases.
But how can we check if a number is Prime or not .....
Well we have a tool for that; Check the below section.
Source : KhanAcademy.com