On to huffman...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KWSW
    New Member
    • May 2007
    • 72

    #16
    thanks for all the help today... gonna give it one more shot than get some sleep can carry on tmr... :)

    Comment

    • KWSW
      New Member
      • May 2007
      • 72

      #17
      Originally posted by KWSW
      thanks for all the help today... gonna give it one more shot than get some sleep can carry on tmr... :)
      ok this is rather interesting but i added a static var(0) and another one x which is = the static var++.

      somehow it works... was playing on the fact that every time a node is created the value of x would increase from the base value of the static var. than just compare the 2 node's value of x and somehow it works...

      dunno how it works but thought i just share it here if anyone else is having the same problem as me. would be nice if someone explains it to me as well...

      now to figure out how to encode but its time to sleep... nights and many thanks again to JosAH :)

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #18
        Originally posted by KWSW
        ok this is rather interesting but i added a static var(0) and another one x which is = the static var++.

        somehow it works... was playing on the fact that every time a node is created the value of x would increase from the base value of the static var. than just compare the 2 node's value of x and somehow it works...

        dunno how it works but thought i just share it here if anyone else is having the same problem as me. would be nice if someone explains it to me as well...

        now to figure out how to encode but its time to sleep... nights and many thanks again to JosAH :)
        You're welcome of course; as I wrote above: if the frequencies differ all is fine;
        if they don't you need another (consistent) way to make those nodes different.
        Here's a small example: A(1) B(2) B(3) B(4) C(5) C(6) D(7) E(8) etc.

        The A, B, C, etc represent the frequencies; where they are equal that serial
        number (your static counter) makes the difference for the nodes, so no two
        nodes are considered equal and that is just what you need for that set.

        kind regards,

        Jos

        Comment

        Working...