Skip to content

Commit

Permalink
rebuild README
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed May 16, 2018
1 parent a46e622 commit ed9300d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</div>
</nav>

<div class="content" data-ice="content"><div data-ice="index" class="github-markdown"><h1 id="-a-href--https---www-npmjs-com-package--clarketm-super--super--a-"><a href="https://www.npmjs.com/package/@clarketm/super">Super</a></h1><p><strong>Data Structures</strong> with superpowers! &#x1F4AA;&#x1F60E;&#x1F44D;</p>
<div class="content" data-ice="content"><div data-ice="index" class="github-markdown"><h1 id="-a-href--https---www-npmjs-com-package--clarketm-super--super--a-"><a href="https://www.npmjs.com/package/@clarketm/super">Super</a></h1><p><strong>Data Structures</strong> with superpowers! &#x1F4AA;&#x1F60E;</p>
<blockquote>
<p>&lt;sub&gt;implemented in <strong>JavaScript</strong>.&lt;/sub&gt;</p>
</blockquote>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4568,7 +4568,7 @@
},
{
"kind": "index",
"content": "# [Super](https://www.npmjs.com/package/@clarketm/super)\n\n**Data Structures** with superpowers! 💪😎👍\n\n> <sub>implemented in **JavaScript**.</sub>\n\n[![hero](https://github.com/clarketm/super/blob/master/resources/hero.png)](https://github.com/clarketm/super)\n\n## Installation\n\n### Yarn\n\n```bash\n$ yarn add @clarketm/super\n```\n\n### Npm\n\n```bash\n$ npm install @clarketm/super --save\n```\n\n## Usage\n\n```js\n// 1. import `each` module `independently`\nimport { Array, Map, Queue, Trie, ... } from \"@clarketm/super\";\n\nlet array = new Array([1, 2]);\n...\n\n// 2. import `all` modules under a `namespace`\nimport Super from \"@clarketm/super\";\n\nlet array = new Super.Array([1, 2]);\n...\n```\n\n## Data Structures\n\n### [Array](https://github.com/clarketm/super/tree/master/packages/Array#readme)\n\n```js\nimport { Array } from \"@clarketm/super\";\n\nlet array = new Array([0, 1, 2, 3]); // [0, 1, 2, 3]\n\n// Use any built-in Array methods:\narray.push(4); // [0, 1, 2, 3, 4]\n\n// Use custom methods (e.g. `flatten`):\nlet array = new Array([[[1]], [[2]], [[3]]]);\narray.flatten(2); // [1, 2, 3]\n```\n\n<br>\n\n### [BinaryTree](https://github.com/clarketm/super/tree/master/packages/BinaryTree#readme)\n\n```js\nimport { BinaryTree } from \"@clarketm/super\";\n\nlet tree = new BinaryTree([5, 3, 7, 2, 8, 4, 6, 1]);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// /\n// 1\n\ntree.root; // BinaryTreeNode { _value: 5, ... }\ntree.height; // 1\n\ntree.insert(9);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// / \\\n// 1 9 -> node inserted\n//\n\ntree.search(3); // BinaryTreeNode { _value: 3, ... }\n\ntree.remove(9);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// /\n// 1 -> node removed\n//\n```\n\n<br>\n\n### [LinkedList](https://github.com/clarketm/super/tree/master/packages/LinkedList#readme)\n\n```js\nimport { LinkedList } from \"@clarketm/super\";\n\nlet list = new LinkedList([1, 3, 5, 7]);\n\n// 1 <-> 3 <-> 5 <-> 7\n\nlist.size; // 4\nlist.head; // ListNode { _value: 1, ... }\nlist.tail; // ListNode { _value: 7, ... }\n\nlist.insert(1, 100);\n\n// node inserted at pos: 1\n// ^\n// 1 <-> 100 <-> 3 <-> 5 <-> 7\n\nlist.append(99);\n\n// node inserted at tail\n// ^\n//   1   <->   100   <->   3   <->   5   <->   7 <-> 99\n\nlist.remove(-1);\n\n// node removed from tail\n// ^\n//   1   <->   100   <->   3   <->   5   <->   7\n\nlist.toArray(); // [ 1, 100, 3, 5, 7 ]\n```\n\n<br>\n\n### [Map](https://github.com/clarketm/super/tree/master/packages/Map#readme)\n\n```js\nimport { Map } from \"@clarketm/super\";\n\nlet map = new Map([[\"a\", 1], [\"b\", 2], [\"c\", 3]]); // Map { 'a' => 1, 'b' => 2, 'c' => 3 }\n\n// Use any built-in Map methods:\nmap.get(\"c\"); // 3\n\n// Use custom methods (e.g. `setDefault`):\n// note: `setDefault` is similar to get(), but will set key to a defaultValue if the key is not in Map.\n\nlet item = map.setDefault(\"c\", 3);\nitem; // 3\nmap; // Map { 'a' => 1, 'b' => 2, 'c' => 3 }\n\nlet item = map.setDefault(\"d\", 4);\nitem; // 4\nmap; // Map { 'a' => 1, 'b' => 2, 'c' => 3 'd' => 4 }\n```\n\n<br>\n\n### [Object](https://github.com/clarketm/super/tree/master/packages/Object#readme)\n\n```js\nimport { Object } from \"@clarketm/super\";\n\nlet object = new Object({ a: 1, b: true, c: 4 }); // Object { a: 1, b: true, c: 4 }\n\n// Use any built-in Object methods:\nObject.keys(object); // [ 'a', 'b', 'c' ]\n\n// Use custom methods (e.g. `clone`):\n// note: `clone` will create a deep copy of the object.\n\nlet clone = object.clone(); // Object { a: 1, b: true, c: 4 }\nObject.is(object, clone); // false\n```\n\n<br>\n\n### [PriorityQueue](https://github.com/clarketm/super/tree/master/packages/PriorityQueue#readme)\n\n**TODO**\n\n### [Queue](https://github.com/clarketm/super/tree/master/packages/Queue#readme)\n\n```js\nimport { Queue } from \"@clarketm/super\";\n\nlet queue = new Queue([2, 4, 6, 8]);\n\n// front rear\n// ^ ^\n// | 2 | 4 | 6 | 8 |\n\nqueue.size; // 4\nqueue.front; // 2\nqueue.rear; // 8\n\nqueue.isEmpty(); // false\n\nqueue.enqueue(10); // 5 : new size\n\n// front rear\n// ^ ^\n// | 2 | 4 | 6 | 8 | 10 |\n\nqueue.dequeue(); // 2 : dequeued item\n\n// front rear\n// ^ ^\n// | 4 | 6 | 8 | 10 |\n\nqueue.clear();\nqueue.size; // 0\n```\n\n<br>\n\n### [Set](https://github.com/clarketm/super/tree/master/packages/Set#readme)\n\n```js\nimport { Set } from \"@clarketm/super\";\n\nlet setA = new Set([1, 2, 3]); // Set { 1, 2, 3 }\nlet setB = new Set([2, 3, 4]); // Set { 2, 3, 4 }\n\n// Use any built-in Set methods:\nsetA.has(1); // true\n\n// Use custom methods:\n\n// `isSubset`\nsetA.isSubset(setB); // false\n\n// `isSuperset`\nsetA.isSuperset(setB); // false\n\n// `union`\nsetA.union(setB); // Set { 1, 2, 3, 4 }\n\n// `intersection`\nsetA.intersection(setB); // Set { 2, 3 }\n\n// `difference`\nsetA.difference(setB); // Set { 1 }\n\n// `symmetricDifference`\nsetA.symmetricDifference(setB); // Set { 1, 4 }\n```\n\n<br>\n\n### [Trie](https://github.com/clarketm/super/tree/master/packages/Trie#readme)\n\n```js\nimport { Trie } from \"@clarketm/super\";\n\nlet trie = new Trie([\"me\", \"men\", \"go\"]);\n\n//             root\n//           / \\\n// 'm' 'g'\n// / \\\n//   $ <- 'e'     'o' -> $\n// /\n// $ <- 'n'\n//\n// $: denotes a complete word\n//\n\ntree.root; // TrieNode { _char: √, ... }\n\ntree.insert(\"met\");\n\n//             root\n//           / \\\n// 'm' 'g'\n// / \\\n//   $ <- 'e'     'o' -> $\n// / \\\n// $ <- 'n' 't' -> $\n//\n// $: denotes a complete word\n//\n\n// `word` search w/ `contains`\ntree.contains(\"me\"); // true\n\n// `prefix` search w/ `startsWith`\ntree.startsWith(\"m\"); // true\n\n// Return a full Match object w/ `search`\ntree.search(\"men\");\n\n// Match object\n// {\n// query: 'men',\n// matchedChars: 3,\n// isMatch: true,\n// isCompleteWord: true,\n// node: TrieNode { ... }\n// }\n\ntree.remove(\"go\");\n\n//             root\n//           /\n// 'm'\n// /\n//   $ <- 'e'\n// / \\\n// $ <- 'n' 't' -> $\n//\n// $: denotes a complete word\n//\n```\n\n<br>\n\n## Data Types\n\n* [Number](https://github.com/clarketm/super/tree/master/packages/Number#readme)\n* [Math](https://github.com/clarketm/super/tree/master/packages/Math#readme)\n* [String](https://github.com/clarketm/super/tree/master/packages/String#readme)\n\n## Credits\n\n* Icons made by <a href=\"http://www.freepik.com\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a> is licensed by <a href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\">CC 3.0 BY</a></div>\n",
"content": "# [Super](https://www.npmjs.com/package/@clarketm/super)\n\n**Data Structures** with superpowers! 💪😎\n\n> <sub>implemented in **JavaScript**.</sub>\n\n[![hero](https://github.com/clarketm/super/blob/master/resources/hero.png)](https://github.com/clarketm/super)\n\n## Installation\n\n### Yarn\n\n```bash\n$ yarn add @clarketm/super\n```\n\n### Npm\n\n```bash\n$ npm install @clarketm/super --save\n```\n\n## Usage\n\n```js\n// 1. import `each` module `independently`\nimport { Array, Map, Queue, Trie, ... } from \"@clarketm/super\";\n\nlet array = new Array([1, 2]);\n...\n\n// 2. import `all` modules under a `namespace`\nimport Super from \"@clarketm/super\";\n\nlet array = new Super.Array([1, 2]);\n...\n```\n\n## Data Structures\n\n### [Array](https://github.com/clarketm/super/tree/master/packages/Array#readme)\n\n```js\nimport { Array } from \"@clarketm/super\";\n\nlet array = new Array([0, 1, 2, 3]); // [0, 1, 2, 3]\n\n// Use any built-in Array methods:\narray.push(4); // [0, 1, 2, 3, 4]\n\n// Use custom methods (e.g. `flatten`):\nlet array = new Array([[[1]], [[2]], [[3]]]);\narray.flatten(2); // [1, 2, 3]\n```\n\n<br>\n\n### [BinaryTree](https://github.com/clarketm/super/tree/master/packages/BinaryTree#readme)\n\n```js\nimport { BinaryTree } from \"@clarketm/super\";\n\nlet tree = new BinaryTree([5, 3, 7, 2, 8, 4, 6, 1]);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// /\n// 1\n\ntree.root; // BinaryTreeNode { _value: 5, ... }\ntree.height; // 1\n\ntree.insert(9);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// / \\\n// 1 9 -> node inserted\n//\n\ntree.search(3); // BinaryTreeNode { _value: 3, ... }\n\ntree.remove(9);\n\n//             5 -> root\n//           / \\\n// 3 7\n// / \\ / \\\n// 2 4 6 8\n// /\n// 1 -> node removed\n//\n```\n\n<br>\n\n### [LinkedList](https://github.com/clarketm/super/tree/master/packages/LinkedList#readme)\n\n```js\nimport { LinkedList } from \"@clarketm/super\";\n\nlet list = new LinkedList([1, 3, 5, 7]);\n\n// 1 <-> 3 <-> 5 <-> 7\n\nlist.size; // 4\nlist.head; // ListNode { _value: 1, ... }\nlist.tail; // ListNode { _value: 7, ... }\n\nlist.insert(1, 100);\n\n// node inserted at pos: 1\n// ^\n// 1 <-> 100 <-> 3 <-> 5 <-> 7\n\nlist.append(99);\n\n// node inserted at tail\n// ^\n//   1   <->   100   <->   3   <->   5   <->   7 <-> 99\n\nlist.remove(-1);\n\n// node removed from tail\n// ^\n//   1   <->   100   <->   3   <->   5   <->   7\n\nlist.toArray(); // [ 1, 100, 3, 5, 7 ]\n```\n\n<br>\n\n### [Map](https://github.com/clarketm/super/tree/master/packages/Map#readme)\n\n```js\nimport { Map } from \"@clarketm/super\";\n\nlet map = new Map([[\"a\", 1], [\"b\", 2], [\"c\", 3]]); // Map { 'a' => 1, 'b' => 2, 'c' => 3 }\n\n// Use any built-in Map methods:\nmap.get(\"c\"); // 3\n\n// Use custom methods (e.g. `setDefault`):\n// note: `setDefault` is similar to get(), but will set key to a defaultValue if the key is not in Map.\n\nlet item = map.setDefault(\"c\", 3);\nitem; // 3\nmap; // Map { 'a' => 1, 'b' => 2, 'c' => 3 }\n\nlet item = map.setDefault(\"d\", 4);\nitem; // 4\nmap; // Map { 'a' => 1, 'b' => 2, 'c' => 3 'd' => 4 }\n```\n\n<br>\n\n### [Object](https://github.com/clarketm/super/tree/master/packages/Object#readme)\n\n```js\nimport { Object } from \"@clarketm/super\";\n\nlet object = new Object({ a: 1, b: true, c: 4 }); // Object { a: 1, b: true, c: 4 }\n\n// Use any built-in Object methods:\nObject.keys(object); // [ 'a', 'b', 'c' ]\n\n// Use custom methods (e.g. `clone`):\n// note: `clone` will create a deep copy of the object.\n\nlet clone = object.clone(); // Object { a: 1, b: true, c: 4 }\nObject.is(object, clone); // false\n```\n\n<br>\n\n### [PriorityQueue](https://github.com/clarketm/super/tree/master/packages/PriorityQueue#readme)\n\n**TODO**\n\n### [Queue](https://github.com/clarketm/super/tree/master/packages/Queue#readme)\n\n```js\nimport { Queue } from \"@clarketm/super\";\n\nlet queue = new Queue([2, 4, 6, 8]);\n\n// front rear\n// ^ ^\n// | 2 | 4 | 6 | 8 |\n\nqueue.size; // 4\nqueue.front; // 2\nqueue.rear; // 8\n\nqueue.isEmpty(); // false\n\nqueue.enqueue(10); // 5 : new size\n\n// front rear\n// ^ ^\n// | 2 | 4 | 6 | 8 | 10 |\n\nqueue.dequeue(); // 2 : dequeued item\n\n// front rear\n// ^ ^\n// | 4 | 6 | 8 | 10 |\n\nqueue.clear();\nqueue.size; // 0\n```\n\n<br>\n\n### [Set](https://github.com/clarketm/super/tree/master/packages/Set#readme)\n\n```js\nimport { Set } from \"@clarketm/super\";\n\nlet setA = new Set([1, 2, 3]); // Set { 1, 2, 3 }\nlet setB = new Set([2, 3, 4]); // Set { 2, 3, 4 }\n\n// Use any built-in Set methods:\nsetA.has(1); // true\n\n// Use custom methods:\n\n// `isSubset`\nsetA.isSubset(setB); // false\n\n// `isSuperset`\nsetA.isSuperset(setB); // false\n\n// `union`\nsetA.union(setB); // Set { 1, 2, 3, 4 }\n\n// `intersection`\nsetA.intersection(setB); // Set { 2, 3 }\n\n// `difference`\nsetA.difference(setB); // Set { 1 }\n\n// `symmetricDifference`\nsetA.symmetricDifference(setB); // Set { 1, 4 }\n```\n\n<br>\n\n### [Trie](https://github.com/clarketm/super/tree/master/packages/Trie#readme)\n\n```js\nimport { Trie } from \"@clarketm/super\";\n\nlet trie = new Trie([\"me\", \"men\", \"go\"]);\n\n//             root\n//           / \\\n// 'm' 'g'\n// / \\\n//   $ <- 'e'     'o' -> $\n// /\n// $ <- 'n'\n//\n// $: denotes a complete word\n//\n\ntree.root; // TrieNode { _char: √, ... }\n\ntree.insert(\"met\");\n\n//             root\n//           / \\\n// 'm' 'g'\n// / \\\n//   $ <- 'e'     'o' -> $\n// / \\\n// $ <- 'n' 't' -> $\n//\n// $: denotes a complete word\n//\n\n// `word` search w/ `contains`\ntree.contains(\"me\"); // true\n\n// `prefix` search w/ `startsWith`\ntree.startsWith(\"m\"); // true\n\n// Return a full Match object w/ `search`\ntree.search(\"men\");\n\n// Match object\n// {\n// query: 'men',\n// matchedChars: 3,\n// isMatch: true,\n// isCompleteWord: true,\n// node: TrieNode { ... }\n// }\n\ntree.remove(\"go\");\n\n//             root\n//           /\n// 'm'\n// /\n//   $ <- 'e'\n// / \\\n// $ <- 'n' 't' -> $\n//\n// $: denotes a complete word\n//\n```\n\n<br>\n\n## Data Types\n\n* [Number](https://github.com/clarketm/super/tree/master/packages/Number#readme)\n* [Math](https://github.com/clarketm/super/tree/master/packages/Math#readme)\n* [String](https://github.com/clarketm/super/tree/master/packages/String#readme)\n\n## Credits\n\n* Icons made by <a href=\"http://www.freepik.com\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a> is licensed by <a href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\">CC 3.0 BY</a></div>\n",
"longname": "/Users/clarketm/js/super/README.md",
"name": "./README.md",
"static": true,
Expand Down

0 comments on commit ed9300d

Please sign in to comment.