subject

Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve of eratosthenes is a method of finding prime numbers. it operates as follows: a) create a primitive-type boolean array with all elements initialized to true. array elements with prime indices will remain true. all other array elements will eventually be set to false. b) starting with array index 2, determine whether a given element is true. if so, loop through the remainder of the array and set to false every element whose index is a multiple of the index for the element with value true. then continue the process with the next element with value true. for array index 2, all elements beyond element 2 in the array that have indices which are multiples of 2 (indices 4, 6, 8, 10, etc.) will be set to false; for array index 3, all elements beyond element 3 in the array that have indices which are multiples of 3 (indices 6, 9, 12, 15, etc.) will be set to false; and so on. when this process completes, the array elements that are still true indicate that the index is a prime number. these indices can be displayed. write an application that uses an array of 1,000 elements to determine and display the prime numbers between 2 and 999. ignore array elements 0 and 1.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:50, brennarfa
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
image
Computers and Technology, 22.06.2019 12:10, drelisech6467
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
image
Computers and Technology, 22.06.2019 16:00, raizagisselle1273
If a client wants to make minor edits, what should he/she use?
Answers: 3
image
Computers and Technology, 23.06.2019 02:30, jalaholmes2027
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
You know the right answer?
Aprime number is any integer greater than 1 that’s evenly divisible only by itself and 1. the sieve...

Questions in other subjects:

Konu
Physics, 04.02.2020 19:55