Giter Site home page Giter Site logo

practice's Introduction

practice

Miller-Rabin algorithm

Program name: genPrime.py

Argument to your program: m

Command line usage of your script: genPrime.py <m>

Output: Output to terminal the value of prime n in decimal (which would take m-bits to represent in binary).

Example: m = 4, the program will output either 11 or 13.

Huffman algorithm

Program name: header.py

Argument to your program: An input text file containing a string str[0 . . . nn1]. It is safe to assume that:

  • str consists of ASCII characters (characters are not restricted to be lower case only!).
  • There are no line breaks in the input file.

Command line usage of your script: header.py <input text file>

Output format: The output is a text file containing a header for the input string str. The header is a bitstring (see the note above which details how to represent the bits) made up of the following information:

  • The number of unique ASCII characters in str encoded using the corresponding Elias ω integer code.
  • For each unique character in the text:
    • Encode the unique character using the fixed-length 7-bit ASCII code. (All input characters will have ASCII values < 128).
    • Then encode the length of the Huffman code assigned to that unique character using an Elias ω code.
    • To the above, append the variable-length Huffman codeword assigned to that unique character.

Example:

aacaacabcaba ==> 011110000111110001001000110001101001

Lempel-Ziv-Storer-Szymanski (LZSS) decoder

a variation of the LZ77 algorithm.

Example:

01111000011111000100100011000110100100011111111010011000100100001101111 ==> aacaacabcaba

practice's People

Contributors

kai08-cn avatar

Watchers

 avatar

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.