Algorithms: My Programming Playground

Place for practicing and improving my coding skills


05 Nov 2016 View Comments
#algorithm #programming #computer #practice #improve

New Project: Algorithms

During the past weeks, I have been spending time writing algorithms and I created a repository in GitHub which has mixed levels of algorithms I have been dealing with in the past. It just used to be a simple set of problems in text files in my local drive. Then, I decided to mavenize this and turn it into a project so I can build/test using Maven which solved my dependency mess and now it feels a lot more like a project. Also, I have added unit tests for each algorithm. The best way to run the test is through a debug mode and step through what is happening behind the scene since many of algorithms happen in the back.

Why did I do this?

Actually, for a quite some time, I wanted a place like this , a place where I can code, play and have fun! Now I finally have a place where I can continue writing more algorithms in the future. The majority of the problems here are mostly the simple ones because I wanted to start from the basics. I find basics are really important as it nourishes me to go a step further.

Why Maven?

  1. Maven can resolve dependencies: I do not need to manually download required libraries and install.
  2. Maven requires you to keep the defined structure: src/main, src/test, and resources. It follows strict directory structures which keep the project clean, organized, and easy to follow.

Maven is much more powerful than how I am using it here. It can handle packaging/releases and define much more through pom file. The best website to start learning about Maven would be the actual Maven Website. I wouldn’t recommend reading an entire book; reading up on specific references on Google should be enough for what you would like to achieve out of it.

Unit tests

Unit tests are done in JUnit 4. “Mockito” is just used for a simple verification. The majority of the problems here are mostly focused on individual functions and independent to Mock something as an object. I also focused on covering all areas of functions to check for entire validity.

How to install

Requirement: Java 8, Lombok, JUnit 4, Slf4j, Mockito

  1. Clone https://github.com/stalk-calvin/Algorithms.git and Load pom.xml as a Maven project.
  2. You may need to enable annotations / necessary plugins to use Lombok for your IDE (You can refer to here on how to do this)

You can also run maven commands to do a full testing, mvn clean test.

Enjoy!

Share this post

Me

I am a passionate programmer working in Vancouver. I strongly believe in art of algorithms and together with it to write clean and efficient software to build awesome products. If you would like to connect with me, choose one from below options :) You can also send me an email at