943,458 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3778
  • C RSS
Jul 28th, 2003
0

Algorithm for checking contiguous blocks

Expand Post »
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.
Similar Threads
ilw
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ilw is offline Offline
1 posts
since Jul 2003

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: Bitwise operators
Next Thread in C Forum Timeline: Sarcasm!!





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


Follow us on Twitter


© 2011 DaniWeb® LLC