Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FizzBuzz in Symta

Name: Anonymous 2022-11-05 23:35

Name: Anonymous 2022-11-11 22:09

Huffman codes for a string:
S "osteoclasts undergo apoptosis at the end of the bone resorption phase"
D!; S{&D.?+1} //count frequencies
H heap; D{|H.push@?{}} //add frequencies to heap
(H.n-1){I=|A H.pop; B H.pop; H.push A.0+B.0 A.1,B.1} //build tree
C [[]H.pop.1](:D,[L R] = @[0,@D L]^r @[1,@D R]^r; D,C=:C,D) //unroll tree
say C.s(?1.n<??1.n) //output sorted by code length

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List