{"id":13432324,"url":"https://github.com/barretlee/algorithms","last_synced_at":"2025-04-09T14:09:13.955Z","repository":{"id":146464506,"uuid":"59494888","full_name":"barretlee/algorithms","owner":"barretlee","description":"All algorithms writing with javascript in the book 'Algorithms Fourth Edition'.","archived":false,"fork":false,"pushed_at":"2017-07-06T07:48:38.000Z","size":34,"stargazers_count":336,"open_issues_count":14,"forks_count":41,"subscribers_count":41,"default_branch":"master","last_synced_at":"2024-04-14T06:52:16.602Z","etag":null,"topics":["algorithm","algorithms-fourth-edition","algorithms-writing","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barretlee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-23T15:36:30.000Z","updated_at":"2024-07-31T03:53:01.410Z","dependencies_parsed_at":"2023-07-17T16:33:46.893Z","dependency_job_id":null,"html_url":"https://github.com/barretlee/algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barretlee%2Falgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barretlee%2Falgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barretlee%2Falgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barretlee%2Falgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barretlee","download_url":"https://codeload.github.com/barretlee/algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054197,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms-fourth-edition","algorithms-writing","javascript"],"created_at":"2024-07-31T02:01:10.334Z","updated_at":"2025-04-09T14:09:13.933Z","avatar_url":"https://github.com/barretlee.png","language":"JavaScript","readme":"Algorithms in JavaScript\n---\n\n**[Detail \u0026 Discusion (讨论和细节)](https://github.com/barretlee/algorithms/issues)**\n\nAll algorithms writing with JavaScript in book '[Algorithms Fourth Edition](http://www.amazon.com/Algorithms-4th-Robert-Sedgewick/dp/032157351X?ie=UTF8\u0026keywords=Algorithms%20Fourth%20Edition\u0026qid=1464068185\u0026ref_=sr_1_1\u0026sr=8-1)'.\n\n### Usage\n\nRun `generator/create.js` to generate code template.\n\n```bash\n# create a file with `file.xtpl` at `chapter/chapter-1-xxx/1.2-xxx/test.js`\nnode generator/create 1.2/test\n\n# delete file `chapter/chapter-1-xxx/1.2-xxx/test.js` if exists\nnode generator/create 1.2/test -d\n```\n\nThe template is: \n\n```javascript\nconsole.log('\u003c%- fileName %\u003e:')\n/* input start */\nvar input = require('../../../generator/index').getRandomNumbers();\n/* input end */\nconsole.log('\u003e input: ' + input);\n\n\n// \u003c%- fileName %\u003e\nfunction \u003c%- fileName %\u003e(input) {\n  var output;\n  return output;\n}\n\n\n/* output start */\nconsole.log('\u003e output: ' + \u003c%- fileName %\u003e(input));\n/* output end */\n```\n\nThere are many functions in `genetator/index` for generating data. such as:\n\n```javascript\nvar input = require('./generator/index').getRandomNumbers();\n// -\u003e [random numbers which length is default 20 between 0 to 1E5]\n```\n\n\n### License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 小胡子哥","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarretlee%2Falgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarretlee%2Falgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarretlee%2Falgorithms/lists"}