What would the big-oh run time be for this loop?
for (int k =j/2; k < n/2; k++)
Algorithm run time analysis
Page 1 of 14 Replies - 1016 Views - Last Post: 25 October 2015 - 01:05 PM
Replies To: Algorithm run time analysis
#2
Re: Algorithm run time analysis
Posted 22 October 2015 - 11:47 PM
Moved to Computer Science.
What have you tried? What do you think?
What have you tried? What do you think?
#3
Re: Algorithm run time analysis
Posted 22 October 2015 - 11:53 PM
#4
Re: Algorithm run time analysis
Posted 23 October 2015 - 10:57 AM
Note that O(log n) is a subset of O(n). However, O(n) is the correct bound. You start at some constant less than n and go to some constant multiple of n. If j == 0, it's still O(n), right?
#5
Re: Algorithm run time analysis
Posted 25 October 2015 - 01:05 PM
Is more context provided? What is j? How does it relate to n?
Page 1 of 1

New Topic/Question
Reply


MultiQuote








|