Skip to main content

Timeline for Implementation of Huffman Coding

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Apr 27, 2020 at 10:54 comment added JVApen You indeed make a copy of the shared_ptr when creating variable x, which is needed. However, when passing it along to the new node, you could move it.
Apr 27, 2020 at 2:08 comment added Brady Dean Since queue.top() returns a const shared_ptr& - and even if I made x and y const, should I still use move on them? I'm getting warnings to not move const variables. I'm assuming it will handle the reference counts correctly and the warning may not apply in this situation.
Apr 27, 2020 at 1:56 vote accept Brady Dean
Apr 26, 2020 at 15:52 comment added JVApen Even than, if you know the characters, depending on the length of the text, it might be beneficial to use hash_map and at the end loop over all characters and locate. Though that all depends on the use cases.
Apr 26, 2020 at 12:59 comment added Brady Dean Thanks for responding. I used map over unordered_map because my calling code needed to output the table with ascii values in order.
Apr 26, 2020 at 8:23 history answered JVApen CC BY-SA 4.0