• Find fun in algorithm - Matrix Rotation

    Matrix Rotation Question Given a NxN matrix, where each element in the matrix is integer, write a method to rotate the matrix by 90 degrees. Answer We can separate the question to a set of small questions. The matrix could be considered as N/2 layers, which is a circle from...


  • Find fun in algorithm - KMP algorithm

    KMP algorithm String search algorithm When you have a string “abacaabacabacabaabb”, we call it target string(T). Then there is another string “abacab” named matching string(M). How to figure out the start index in T which match M? If we look into it, we could find that if start from the...


  • Find fun in algorithm - array [1]

    Find fun in algorithm (In Java) Preface Algorithm always be boring and hard to be understood, I didn’t learn it very well in college. After graduated, I spend much of my time on programming language, such as C, Java, Javasript etc. But after worked for several years, I noticed that...


  • Set up blog by jekyll on github

    Download the resources you needed Go to http://rubyinstaller.org/downloads/ download ruby for using gem in cmd, you need download two packages: Ruby 2.2.2 (x64) DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe Extract devkit to a directory, go into it and execute ruby dk.rb init, then open config.yml and add the home of ruby at the bottom, like...