Skip to content

Instantly share code, notes, and snippets.

@bqqbarbhg
Created July 14, 2013 20:22
Show Gist options
  • Save bqqbarbhg/5995811 to your computer and use it in GitHub Desktop.
Save bqqbarbhg/5995811 to your computer and use it in GitHub Desktop.

Packet fill algorithm

P := largest packet
while (true)
  while (P overflows)
    send part
  append P
  while (exists packets that won't overflow)
    append largest of them
  if (exists packets that would be less fragmented if started here)
    P := largest of them
  else
    send
    if (no more packets)
      break
    else
      P := largest packet
@oamaok
Copy link

oamaok commented Mar 3, 2016

hello

this is nice code thank mr skeltal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment