| | |
recursion complexity
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Jul 2009
Posts: 9
Reputation:
Solved Threads: 0
The equation you gave, if the first term is corrected to t(k), should give a complexity of O(nk log k). Another algorithm that could do this was to use a heap -- it was so that you could get the elements of the final array in order -- so the complexity was O(m log k) where m is the number of smallest elements you want in the final array, and you do not need to have the k arrays to be of a certain size.
for each array as F: heap_insert(read_next(F),F);
while heap_pop_min as (M,X): output(M); heap_insert(read_next(X),X);
for each array as F: heap_insert(read_next(F),F);
while heap_pop_min as (M,X): output(M); heap_insert(read_next(X),X);
![]() |
Similar Threads
- Time complexity of algorithm (Computer Science)
- recursion sierpinskys triangle - HELP!! (Java)
- need help with recursion (C)
- Recursion (C++)
- powers of two, recursion. (C)
- I'm having problem with the complexity of this algorithm! (Computer Science)
- Create menu from properties file by recursion (Java)
- Recursion (C)
Other Threads in the Computer Science Forum
- Previous Thread: Buffer memory and RAM?
- Next Thread: Projects
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignments automata battery bigbrother binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computer computers computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea ideas internet iphone ipod itcontracts jobs kindle laser laws linkbait lsmeans mainframes marketing mobileapplication msaccess nano netbeans networking news os p2p piracy piratebay principles programming rasterizer research sam-being-cute sas science security sex simulation software spying stephenfry study supercomputer supercomputing sweden technology textfield turing turingtest two'scompliment virus ww2





