| | |
Algorithm for checking contiguous blocks
![]() |
•
•
Join Date: Jul 2003
Posts: 1
Reputation:
Solved Threads: 0
Hi
I'm trying to write a program that will work with kazaa dat files (ie the files where kazaa stores the downloaded file). Basically my problem is that i need to check if a 10MB chunk of the file has been downloaded, however kazaa stores what it has downloaded in the format:
Chunk start position and size of chunk downloaded
and the chunks areen't necessarily in the correct order. Also the chunk sizes and start positions can be fairly random.
So it might look a little like this:
0, 100 (so first 100 bytes there)
100, 100 (2nd 100 bytes there)
210, 175 (so bytes 200 - 210 are missing
485, 115
385, 100
etc
I either need to know which chunks are all there or the reverse ie which bits are missing. Does anyone have any ideas or know anywhere where i might be able to find an algorithm that could do this. My only idea was to do a bubble sort and then go through check if the end of one is the beginning of the next, but since the start position and chunk size are stored in different arrays i couldn't see how that could be done.
I'm trying to write a program that will work with kazaa dat files (ie the files where kazaa stores the downloaded file). Basically my problem is that i need to check if a 10MB chunk of the file has been downloaded, however kazaa stores what it has downloaded in the format:
Chunk start position and size of chunk downloaded
and the chunks areen't necessarily in the correct order. Also the chunk sizes and start positions can be fairly random.
So it might look a little like this:
0, 100 (so first 100 bytes there)
100, 100 (2nd 100 bytes there)
210, 175 (so bytes 200 - 210 are missing
485, 115
385, 100
etc
I either need to know which chunks are all there or the reverse ie which bits are missing. Does anyone have any ideas or know anywhere where i might be able to find an algorithm that could do this. My only idea was to do a bubble sort and then go through check if the end of one is the beginning of the next, but since the start position and chunk size are stored in different arrays i couldn't see how that could be done.
![]() |
Similar Threads
- pointer assignment (C)
- Connect 4 game (C++)
- need help! (Java)
- Please help. Give me a solution (C++)
- Structure for low memory, 'seen' queries. (Computer Science)
- Linked List (C++)
- (another) big O question (Computer Science)
- Narue's Heap sort a further explanation? (C)
- Time-table Preparing (Java)
Other Threads in the C Forum
- Previous Thread: Bitwise operators
- Next Thread: Sarcasm!!
| Thread Tools | Search this Thread |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi





