Coder Social home page Coder Social logo

bitziplib's People

Contributors

bogdasar1985 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bitziplib's Issues

Make two types of function `get_code`

  1. void get_code(const huffman& huf, char sym, char **res)
  2. std::string get_code(const huffman& huf)
    These 2 functions should be compiled depending on the compilation flags. (For example -fnostdlib)

Fix compiler warnings

/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp: In member function ‘void hf_priority_queue::shiftDown(long int)’:
/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp:58:28: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   58 |     while ((2 * index + 1) < _heap.size())
      |            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp:63:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   63 |         if((right < _heap.size()) && (_heap[right] < _heap[left]))
      |             ~~~~~~^~~~~~~~~~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp: In member function ‘void hf_priority_queue::shiftDown(long int)’:
/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp:58:28: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   58 |     while ((2 * index + 1) < _heap.size())
      |            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/HuffmanCodeLib/hf_priority_queue.cpp:63:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   63 |         if((right < _heap.size()) && (_heap[right] < _heap[left]))
      |             ~~~~~~^~~~~~~~~~~~~~

Separating interface and implementation

Implementation should be write on C++ 98, be open as possible (I mean methods and variables), and could be unsafe(I mean working with memory falls on the user). User also can use methods from this implementation directly, but as a warning, we put all this in namespace called unsafe.
Using this unsafe namespace and aggregation, we will implement a wrapper-interface compatible with Modern C++ since C++11.

Change reserve policy for `dynamic_array`

  1. It's good, when capacity of dynamic_array is power of two, but it rule broke, when we use dynamic_array::reserve(const size_t capacity).
  2. Also, size of template parameter of dynamic_array may not be power of two, we could fix it, by add padding field to them.

BIG IMPORTANT BUG!

BUILDING WRONG TREE IN DECODER!
build_tree use huffman implementation of priority_queue with specific policy of sorting, it should use normal policy.

Add tests

  • Data structures
    • dynamic array
    • priority queue
    • bitset (#12)
  • Huffman
    • prefix rule

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.