| | |
Need help with Data Structure and Algorithms
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
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?
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?
Homework ?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
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.
Knowledge is regarded by the fool as ignorance, and the things that are profitable are to him hurtful. He liveth in death. -- Thoth the Atlantean
![]() |
Similar Threads
- books on data structures and algorithms in C sharp (C#)
- Data structure + GUI question. (Java)
- a question about heap data structure (C)
- Data Structure Using JAVA (Java)
- How to delete a data structure in Builder 6.0? (C++)
- Discrete Math or Data structure (Computer Science)
Other Threads in the C Forum
- Previous Thread: please check for me the error and tell me~~ thx!
- Next Thread: Multiple files
| Thread Tools | Search this Thread |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h







