Algorithm for checking contiguous blocks

Reply

Join Date: Jul 2003
Posts: 1
Reputation: ilw is an unknown quantity at this point 
Solved Threads: 0
ilw ilw is offline Offline
Newbie Poster

Algorithm for checking contiguous blocks

 
0
  #1
Jul 28th, 2003
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC