Skip to content

All algorithms writing with javascript in the book 'Algorithms Fourth Edition'.

License

Notifications You must be signed in to change notification settings

barretlee/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms in JavaScript

Detail & Discusion (讨论和细节)

All algorithms writing with JavaScript in book 'Algorithms Fourth Edition'.

Usage

Run generator/create.js to generate code template.

# create a file with `file.xtpl` at `chapter/chapter-1-xxx/1.2-xxx/test.js`
node generator/create 1.2/test

# delete file `chapter/chapter-1-xxx/1.2-xxx/test.js` if exists
node generator/create 1.2/test -d

The template is:

console.log('<%- fileName %>:')
/* input start */
var input = require('../../../generator/index').getRandomNumbers();
/* input end */
console.log('> input: ' + input);


// <%- fileName %>
function <%- fileName %>(input) {
  var output;
  return output;
}


/* output start */
console.log('> output: ' + <%- fileName %>(input));
/* output end */

There are many functions in genetator/index for generating data. such as:

var input = require('./generator/index').getRandomNumbers();
// -> [random numbers which length is default 20 between 0 to 1E5]

License

The MIT License (MIT)

Copyright (c) 2016 小胡子哥

About

All algorithms writing with javascript in the book 'Algorithms Fourth Edition'.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •