944,127 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1500
  • C RSS
Sep 12th, 2007
0

Need help with Data Structure and Algorithms

Expand Post »
1.Show that X^62 can be computed with only 8 multiplications.

2.Programs A and B are analyzed and found to have worst-case running times no greater than 150NlgN and N^2, respectively. Answer the following questions, if possible:
1. Which program has the better guarantee on the running time, for large values of N (N > 10,000)?
2. Which program has the better guarantee on the running time, for small values of N (N < 100)?
3. Which program will run faster on average for N = 1000?
4. Is it possible that program B will run faster than program A on all possible inputs?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
calipxo is offline Offline
1 posts
since Sep 2007
Sep 12th, 2007
0

Re: Need help with Data Structure and Algorithms

Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is online now Online
21,961 posts
since Aug 2005
Sep 12th, 2007
0

Re: Need help with Data Structure and Algorithms

Well we would not start to teach you mathematics here, finally this is a programming forum, you may ask these questions in some mathematics or physics forum. But in short, there are other ways to calculate x^y than to multiply x y times, which is even not possible when y is not an integer. For practical programming, it's also sometimes useful to use function tables, may make things very fast.
Reputation Points: 85
Solved Threads: 13
Junior Poster
TkTkorrovi is offline Offline
170 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: please check for me the error and tell me~~ thx!
Next Thread in C Forum Timeline: pause until any key pressed in linux





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC