Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0b9f9e6

Browse files
Merge branch 'minibook'
2 parents 037ab2d + 44e2d30 commit 0b9f9e6

File tree

258 files changed

+9328
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+9328
-679
lines changed

‎.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212

1313
// https://eslint.org/docs/rules/no-plusplus
1414
// allows unary operators ++ and -- in the afterthought (final expression) of a for loop.
15-
"allowForLoopAfterthoughts": true,
15+
"no-plusplus": [2,{"allowForLoopAfterthoughts": true}],
1616

1717
// Allow for..of
1818
"no-restricted-syntax": [0, "ForOfStatement"],

‎.gitignore

Lines changed: 150 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,151 @@
11
node_modules
2-
.idea/
3-
coverage/
2+
.idea
3+
coverage
4+
dist
5+
_book
6+
.DS_Store
7+
8+
# https://raw.githubusercontent.com/mraible/infoq-mini-book/master/.gitignore
9+
######################
10+
# Project Specific
11+
######################
12+
/src/main/webapp/dist
13+
14+
######################
15+
# Node
16+
######################
17+
/node_modules/**
18+
19+
######################
20+
# Eclipse
21+
######################
22+
*.pydevproject
23+
.project
24+
.metadata
25+
/bin/**
26+
/tmp/**
27+
/tmp/**/*
28+
*.tmp
29+
*.bak
30+
*.swp
31+
*~.nib
32+
local.properties
33+
.classpath
34+
.settings/**
35+
.loadpath
36+
37+
# External tool builders
38+
.externalToolBuilders/**
39+
40+
# Locally stored "Eclipse launch configurations"
41+
*.launch
42+
43+
# CDT-specific
44+
.cproject
45+
46+
# PDT-specific
47+
.buildpath
48+
49+
######################
50+
# Intellij
51+
######################
52+
.idea/**
53+
*.iml
54+
*.iws
55+
*.ipr
56+
*.ids
57+
*.orig
58+
59+
######################
60+
# Maven
61+
######################
62+
/log/**
63+
/target/**
64+
65+
######################
66+
# Gradle
67+
######################
68+
.gradle/**
69+
70+
######################
71+
# Ruby
72+
######################
73+
/.bundle/
74+
/Gemfile.lock
75+
76+
######################
77+
# Package Files
78+
######################
79+
*.jar
80+
*.war
81+
*.ear
82+
*.db
83+
84+
######################
85+
# Windows
86+
######################
87+
# Windows image file caches
88+
Thumbs.db
89+
90+
# Folder config file
91+
Desktop.ini
92+
93+
######################
94+
# Mac OSX
95+
######################
96+
.DS_Store
97+
.svn
98+
99+
# Thumbnails
100+
._*
101+
102+
# Files that might appear on external disk
103+
.Spotlight-V100
104+
.Trashes
105+
106+
######################
107+
# Directories
108+
######################
109+
/asciidoctor-pdf/
110+
/build/**
111+
/bin/**
112+
/deploy/**
113+
114+
######################
115+
# Logs
116+
######################
117+
*.log
118+
119+
######################
120+
# Others
121+
######################
122+
*.class
123+
*.*~
124+
*~
125+
.merge_file*
126+
127+
######################
128+
# My files
129+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/Makefile .
130+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/Gemfile .
131+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/Gemfile.lock .
132+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/_conf .
133+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/_resources .
134+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/extensions .
135+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/fonts .
136+
# ln -s ~/OneDrive/Authoring/dsaJS/asciidoc/book/images .
137+
######################
138+
Gemfile
139+
Gemfile.lock
140+
Makefile
141+
_conf
142+
_resources
143+
extensions
144+
fonts
145+
images
146+
147+
148+
######################
149+
# Gradle Wrapper
150+
######################
151+
!gradle/wrapper/gradle-wrapper.jar

‎.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10
1+
10.12.0

‎README.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,3 @@ We are covering the following data structures.
2727
1. **Hash Maps**: implements map using a hash function. [Code](https://github.com/amejiarosario/algorithms.js/blob/master/src/data-structures/hash-maps/hashmap.js) | [Details](https://adrianmejia.com/blog/2018/04/28/data-structures-time-complexity-for-beginners-arrays-hashmaps-linked-lists-stacks-queues-tutorial/#HashMaps)
2828
2. **Tree Maps**: implement map using a self-balanced BST. WIP
2929
3. **Graphs**: data *nodes* that can have a connection or *edge* to zero or more adjacent nodes. Unlike trees, nodes can have multiple parents, loops. [Code](https://github.com/amejiarosario/algorithms.js/blob/master/src/data-structures/graphs/graph.js) | [Details](https://adrianmejia.com/blog/2018/05/14/data-structures-for-beginners-graphs-time-complexity-tutorial/)
30-
31-
## Algorithms
32-
1. Searching algorithms (WIP)
33-
2. Sorting algorithms (WIP)
34-
35-
# Notes
36-
Some notes while working on this project
37-
38-
## Tests
39-
Running one test without changing file
40-
```sh
41-
jest -t '#findNodeAndParent'
42-
```
43-
44-
Running one test changing code
45-
```js
46-
it.only('should return with an element and its parent', () => {
47-
// ...
48-
});
49-
```
50-
51-
## English Words
52-
53-
Getting some (200k+) English words are useful for testing and benchmarking.
54-
55-
```sh
56-
cat /usr/share/dict/words > benchmarks/dict.txt
57-
```
58-
59-
## ESLint
60-
61-
Disabling ESLints
62-
```js
63-
somthing(t) => 1 // eslint-disable-line no-unused-vars
64-
// eslint-disable-next-line no-use-before-define
65-
const thing = new Thing();
66-
67-
/*eslint-disable */
68-
//suppress all warnings between comments
69-
alert('foo');
70-
/*eslint-enable */
71-
72-
/* eslint-disable no-alert, no-console */
73-
alert('foo');
74-
console.log('bar');
75-
/* eslint-enable no-alert */
76-
```

‎benchmarks/hashmap.perf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function useBenchmark() {
113113
const HashMapSmallBucket = require('../src/data-structures/hash-maps/hash-map-2');
114114
const HashMap3 = require('../src/data-structures/hash-maps/hash-map-3');
115115
const HashMap4 = require('../src/data-structures/hash-maps/hash-map-4');
116-
const HashMap = require('../src/data-structures/hash-maps/hashmap');
116+
const HashMap = require('../src/data-structures/hash-maps/hash-map');
117117

118118
// // Map (built-in) x 2,257 ops/sec ±2.42% (75 runs sampled)
119119
// suite.add('Map (built-in)', function() {

‎book/book-all.adoc

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
include::_conf/variables.adoc[]
2+
3+
= {doctitle}
4+
5+
// remove numbering from titles, and sub-titles e.g. 1.1
6+
:sectnums!:
7+
8+
// Copyright © 2018 Adrian Mejia
9+
include::chapters/colophon.adoc[]
10+
11+
// Abstract and Dedication MUST have a level-0 heading in EPUB and Kindle
12+
// but level-1 in PDF and HTML
13+
ifndef::backend-epub3[:leveloffset: +1]
14+
include::chapters/dedication.adoc[]
15+
ifndef::backend-epub3[:leveloffset: -1]
16+
17+
// TODO: pending
18+
include::chapters/preface.adoc[]
19+
20+
include::chapters/cheatsheet.adoc[]
21+
22+
// add sections to chapters
23+
:sectnums:
24+
25+
//
26+
// chapters
27+
//
28+
29+
= Algorithms Analysis
30+
31+
// TODO: pending
32+
include::chapters/algorithms-analysis-intro.adoc[]
33+
34+
:leveloffset: +1
35+
36+
include::chapters/algorithms-analysis.adoc[]
37+
38+
include::chapters/big-o-examples.adoc[]
39+
40+
:leveloffset: -1
41+
42+
= Linear Data Structures
43+
44+
include::chapters/linear-data-structures-intro.adoc[]
45+
46+
:leveloffset: +1
47+
48+
include::chapters/array.adoc[]
49+
50+
include::chapters/linked-list.adoc[]
51+
52+
include::chapters/stack.adoc[]
53+
54+
include::chapters/queue.adoc[]
55+
56+
:leveloffset: -1
57+
58+
= Non-Linear Data Structures
59+
60+
include::chapters/non-linear-data-structures-intro.adoc[]
61+
62+
:leveloffset: +1
63+
64+
include::chapters/tree.adoc[]
65+
66+
include::chapters/binary-search-tree.adoc[]
67+
68+
include::chapters/map.adoc[]
69+
70+
include::chapters/set.adoc[]
71+
72+
include::chapters/graph.adoc[]
73+
74+
75+
:leveloffset: -1
76+
77+
= Advanced Non-Linear Data Structures
78+
79+
// TODO: pending
80+
include::chapters/non-linear-data-structures-intro-advanced.adoc[]
81+
82+
:leveloffset: +1
83+
84+
// TODO: pending
85+
include::chapters/avl-tree.adoc[]
86+
87+
// TODO: pending (optional)
88+
// include::chapters/red-black-tree.adoc[]
89+
90+
// TODO: pending
91+
include::chapters/heap.adoc[]
92+
93+
// TODO: (optional) pending
94+
// include::chapters/trie.adoc[]
95+
96+
97+
:leveloffset: -1
98+
99+
= Algorithms
100+
101+
// TODO: pending
102+
include::chapters/algorithms-intro.adoc[]
103+
104+
:leveloffset: +1
105+
106+
// TODO: pending
107+
include::chapters/sorting-intro.adoc[]
108+
109+
//
110+
// Slow Sorting
111+
//
112+
113+
include::chapters/insertion-sort.adoc[]
114+
115+
include::chapters/selection-sort.adoc[]
116+
117+
include::chapters/bubble-sort.adoc[]
118+
119+
//
120+
// Fast Sorting
121+
//
122+
123+
include::chapters/merge-sort.adoc[]
124+
125+
include::chapters/quick-sort.adoc[]
126+
127+
// TODO: (optional) pending
128+
// include::chapters/heap-sort.adoc[]
129+
130+
// TODO: (optional) pending
131+
// include::chapters/tim-sort.adoc[]
132+
133+
//
134+
// Searching
135+
//
136+
137+
// TODO: pending
138+
include::chapters/graph-search.adoc[]
139+
140+
:leveloffset: -1
141+
142+
//
143+
// end chapters
144+
//
145+
146+
include::chapters/epigraph.adoc[]
147+
148+
// TODO: (optional) pending
149+
// include::chapters/appendix.adoc[]
150+
151+
// TODO: (optional) pending
152+
ifdef::backend-pdf[]
153+
include::chapters/index.adoc[]
154+
endif::[]
155+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /