This is the submodule of code-warrior, which include all algorithm questions and test cases for code-warrior
- binary search
- fabonacci
- quicksort
- tree traversal
- breadth and depth first search
- linked list remove
- insertion sort
- merge sort
- tree depth
- frequency of occurrences
- adds without +
- find all pair sum
- the game of master mind
- tic-tac-toe
- factorial trailing zeros
- max with bit
- number to words
- continous sequence sum
- different numbers
- shortest distance between words
- find n-largest number
Every question will fit in three levels: basic, moderate and hard and in the folder which named by the question id.
list.json file included all files in all levels.
Each question included:
- readme.md : explain the question.
- index.js : a stub for implementing answer.
- test.js : mocha test cases to ensure the answer is correct
- package.js : id, name, author of the question
First, create a folder named as question name in ./temp,
Generate question by code-warrior:
war generate
will create pacakge.json, index.js, test.js and readme.md
next, implement the test.js and make sure the test case can validate the program is correct. If you write the answer, save in answer.js and leave index.js as stub.
Send pull request to the repository, it will be merged after tested and set with level and id.