Добавить
Уведомления

Java M14GA1P1c Naive Prime - Compute and analyze

This video describes the method to compute the prime numbers and analyze the obtained results. * Module 14: Prime numbers and optimization * Guided Activity 1: Naive method for prime numbers * Program 1: Naive Prime * Given a number n in the command line, * compute and print all the prime numbers less or equal with n. * * Use a naive method to test for each number k from 2 to n if it is prime. * The test will consider all numbers from 2 to k-1 and see if they are divisors of k. * If none is, then the number is prime. * * Print the numbers as identified 10 per line. * * Compute the execution time for the entire program.

Иконка канала Кодовый Лагерь
7 подписчиков
12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

This video describes the method to compute the prime numbers and analyze the obtained results. * Module 14: Prime numbers and optimization * Guided Activity 1: Naive method for prime numbers * Program 1: Naive Prime * Given a number n in the command line, * compute and print all the prime numbers less or equal with n. * * Use a naive method to test for each number k from 2 to n if it is prime. * The test will consider all numbers from 2 to k-1 and see if they are divisors of k. * If none is, then the number is prime. * * Print the numbers as identified 10 per line. * * Compute the execution time for the entire program.

, чтобы оставлять комментарии