Question
Half of the integers stored in the array data are positive, and half are negative. Determine the absolute speed of the following algorithm, assuming: the
Half of the integers stored in the array data are positive, and half are negative. Determine the absolute speed of the following algorithm, assuming: the time to execute a memory access is 100 nanoseconds and that all other operations (arithmetic, register accesses, etc.) take 10 nanoseconds.
for(int i = 0; i<1000000; i++)
{ if(data[i] < 0 )
data[i] = data[i] * 2;
}
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
Answer Firstly we have to take the 10 nanoseconds and then we need to compute the absolute speed of ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Practicing Statistics Guided Investigations For The Second Course
Authors: Shonda Kuiper, Jeff Sklar
1st Edition
321586018, 978-0321586018
Students also viewed these Algorithms questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App