data-structure-typed 0.9.16 → 1.12.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dependency-cruiser.js +449 -0
- package/.idea/data-structure-typed.iml +2 -0
- package/README.md +102 -1
- package/dist/data-structures/binary-tree/avl-tree.d.ts +57 -0
- package/dist/data-structures/binary-tree/avl-tree.js +57 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +27 -0
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +27 -0
- package/dist/data-structures/binary-tree/binary-tree.d.ts +215 -9
- package/dist/data-structures/binary-tree/binary-tree.js +283 -15
- package/dist/data-structures/binary-tree/bst.d.ts +16 -0
- package/dist/data-structures/binary-tree/bst.js +12 -0
- package/dist/data-structures/binary-tree/segment-tree.d.ts +4 -0
- package/dist/data-structures/binary-tree/segment-tree.js +4 -0
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +4 -0
- package/dist/data-structures/binary-tree/tree-multiset.js +4 -0
- package/dist/data-structures/graph/abstract-graph.d.ts +163 -13
- package/dist/data-structures/graph/abstract-graph.js +166 -12
- package/dist/data-structures/graph/directed-graph.d.ts +111 -1
- package/dist/data-structures/graph/directed-graph.js +122 -0
- package/dist/data-structures/graph/undirected-graph.d.ts +63 -0
- package/dist/data-structures/graph/undirected-graph.js +67 -0
- package/dist/data-structures/hash/coordinate-map.d.ts +32 -0
- package/dist/data-structures/hash/coordinate-map.js +32 -0
- package/dist/data-structures/hash/coordinate-set.d.ts +25 -0
- package/dist/data-structures/hash/coordinate-set.js +25 -0
- package/dist/data-structures/heap/heap.d.ts +26 -31
- package/dist/data-structures/heap/heap.js +23 -32
- package/dist/data-structures/heap/max-heap.d.ts +6 -1
- package/dist/data-structures/heap/max-heap.js +6 -1
- package/dist/data-structures/heap/min-heap.d.ts +7 -1
- package/dist/data-structures/heap/min-heap.js +7 -1
- package/dist/data-structures/index.d.ts +0 -1
- package/dist/data-structures/index.js +0 -1
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +14 -6
- package/dist/data-structures/linked-list/doubly-linked-list.js +45 -8
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +11 -8
- package/dist/data-structures/linked-list/singly-linked-list.js +4 -0
- package/dist/data-structures/matrix/matrix.d.ts +9 -0
- package/dist/data-structures/matrix/matrix.js +11 -0
- package/dist/data-structures/matrix/matrix2d.d.ts +82 -2
- package/dist/data-structures/matrix/matrix2d.js +82 -2
- package/dist/data-structures/matrix/navigator.d.ts +32 -0
- package/dist/data-structures/matrix/navigator.js +28 -0
- package/dist/data-structures/matrix/vector2d.d.ts +139 -15
- package/dist/data-structures/matrix/vector2d.js +139 -15
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +8 -0
- package/dist/data-structures/priority-queue/max-priority-queue.js +8 -0
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +8 -0
- package/dist/data-structures/priority-queue/min-priority-queue.js +8 -0
- package/dist/data-structures/priority-queue/priority-queue.d.ts +130 -0
- package/dist/data-structures/priority-queue/priority-queue.js +126 -0
- package/dist/data-structures/queue/deque.d.ts +69 -0
- package/dist/data-structures/queue/deque.js +69 -0
- package/dist/data-structures/queue/queue.d.ts +30 -32
- package/dist/data-structures/queue/queue.js +30 -32
- package/dist/data-structures/stack/stack.d.ts +26 -31
- package/dist/data-structures/stack/stack.js +26 -31
- package/dist/data-structures/trie/trie.d.ts +26 -6
- package/dist/data-structures/trie/trie.js +26 -7
- package/dist/data-structures/types/avl-tree.d.ts +1 -1
- package/dist/data-structures/types/binary-tree.d.ts +1 -1
- package/dist/data-structures/types/index.d.ts +1 -1
- package/dist/data-structures/types/index.js +1 -1
- package/dist/data-structures/types/singly-linked-list.d.ts +1 -5
- package/dist/data-structures/types/tree-multiset.d.ts +1 -1
- package/dist/{data-structures → utils}/trampoline.d.ts +5 -7
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/index.js +17 -0
- package/dist/{data-structures → utils}/types/utils.d.ts +8 -0
- package/dist/{data-structures → utils}/types/utils.js +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +85 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/classes/AVLTree.html +2046 -0
- package/docs/classes/AVLTreeNode.html +423 -0
- package/docs/classes/AaTree.html +117 -0
- package/docs/classes/AbstractEdge.html +198 -0
- package/docs/classes/AbstractGraph.html +891 -0
- package/docs/classes/AbstractVertex.html +164 -0
- package/docs/classes/ArrayDeque.html +384 -0
- package/docs/classes/BST.html +1893 -0
- package/docs/classes/BSTNode.html +425 -0
- package/docs/classes/BTree.html +117 -0
- package/docs/classes/BinaryIndexedTree.html +244 -0
- package/docs/classes/BinaryTree.html +1754 -0
- package/docs/classes/BinaryTreeNode.html +396 -0
- package/docs/classes/Character.html +165 -0
- package/docs/classes/CoordinateMap.html +394 -0
- package/docs/classes/CoordinateSet.html +355 -0
- package/docs/classes/Deque.html +617 -0
- package/docs/classes/DirectedEdge.html +247 -0
- package/docs/classes/DirectedGraph.html +1207 -0
- package/docs/classes/DirectedVertex.html +154 -0
- package/docs/classes/DoublyLinkedList.html +619 -0
- package/docs/classes/DoublyLinkedListNode.html +160 -0
- package/docs/classes/Heap.html +315 -0
- package/docs/classes/Matrix2D.html +447 -0
- package/docs/classes/MatrixNTI2D.html +181 -0
- package/docs/classes/MaxHeap.html +325 -0
- package/docs/classes/MaxPriorityQueue.html +668 -0
- package/docs/classes/MinHeap.html +326 -0
- package/docs/classes/MinPriorityQueue.html +668 -0
- package/docs/classes/Navigator.html +285 -0
- package/docs/classes/ObjectDeque.html +289 -0
- package/docs/classes/PriorityQueue.html +643 -0
- package/docs/classes/Queue.html +337 -0
- package/docs/classes/RBTree.html +117 -0
- package/docs/classes/SegmentTree.html +234 -0
- package/docs/classes/SegmentTreeNode.html +302 -0
- package/docs/classes/SinglyLinkedList.html +1035 -0
- package/docs/classes/SinglyLinkedListNode.html +304 -0
- package/docs/classes/SplayTree.html +117 -0
- package/docs/classes/Stack.html +313 -0
- package/docs/classes/TreeMultiSet.html +1897 -0
- package/docs/classes/Trie.html +317 -0
- package/docs/classes/TrieNode.html +221 -0
- package/docs/classes/TwoThreeTree.html +117 -0
- package/docs/classes/UndirectedEdge.html +220 -0
- package/docs/classes/UndirectedGraph.html +1006 -0
- package/docs/classes/UndirectedVertex.html +154 -0
- package/docs/classes/Vector2D.html +746 -0
- package/docs/enums/CP.html +126 -0
- package/docs/enums/FamilyPosition.html +126 -0
- package/docs/enums/LoopType.html +119 -0
- package/docs/index.html +288 -0
- package/docs/modules.html +146 -0
- package/jest.config.js +5 -0
- package/package.json +19 -11
- package/rename_clear_files.sh +29 -0
- package/src/assets/complexities-diff.jpg +0 -0
- package/src/assets/data-structure-complexities.jpg +0 -0
- package/src/data-structures/binary-tree/avl-tree.ts +57 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +27 -0
- package/src/data-structures/binary-tree/binary-tree.ts +288 -18
- package/src/data-structures/binary-tree/bst.ts +16 -1
- package/src/data-structures/binary-tree/segment-tree.ts +5 -0
- package/src/data-structures/binary-tree/tree-multiset.ts +4 -0
- package/src/data-structures/diagrams/README.md +5 -7
- package/src/data-structures/graph/abstract-graph.ts +167 -15
- package/src/data-structures/graph/diagrams/adjacency-list-pros-cons.jpg +0 -0
- package/src/data-structures/graph/diagrams/adjacency-list.jpg +0 -0
- package/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.jpg +0 -0
- package/src/data-structures/graph/diagrams/adjacency-matrix.jpg +0 -0
- package/src/data-structures/graph/diagrams/dfs-can-do.jpg +0 -0
- package/src/data-structures/graph/diagrams/edge-list-pros-cons.jpg +0 -0
- package/src/data-structures/graph/diagrams/edge-list.jpg +0 -0
- package/src/data-structures/graph/diagrams/max-flow.jpg +0 -0
- package/src/data-structures/graph/diagrams/mst.jpg +0 -0
- package/src/data-structures/graph/diagrams/tarjan.webp +0 -0
- package/src/data-structures/graph/directed-graph.ts +127 -5
- package/src/data-structures/graph/undirected-graph.ts +67 -1
- package/src/data-structures/hash/coordinate-map.ts +32 -0
- package/src/data-structures/hash/coordinate-set.ts +25 -0
- package/src/data-structures/heap/heap.ts +27 -32
- package/src/data-structures/heap/max-heap.ts +6 -1
- package/src/data-structures/heap/min-heap.ts +7 -1
- package/src/data-structures/index.ts +0 -1
- package/src/data-structures/linked-list/doubly-linked-list.ts +49 -8
- package/src/data-structures/linked-list/singly-linked-list.ts +39 -8
- package/src/data-structures/matrix/matrix.ts +11 -0
- package/src/data-structures/matrix/matrix2d.ts +82 -2
- package/src/data-structures/matrix/navigator.ts +32 -0
- package/src/data-structures/matrix/vector2d.ts +139 -15
- package/src/data-structures/priority-queue/max-priority-queue.ts +8 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +8 -0
- package/src/data-structures/priority-queue/priority-queue.ts +130 -0
- package/src/data-structures/queue/deque.ts +69 -0
- package/src/data-structures/queue/queue.ts +30 -32
- package/src/data-structures/stack/stack.ts +26 -31
- package/src/data-structures/trie/trie.ts +26 -7
- package/src/data-structures/types/avl-tree.ts +1 -1
- package/src/data-structures/types/binary-tree.ts +1 -1
- package/src/data-structures/types/bst.ts +1 -1
- package/src/data-structures/types/index.ts +1 -1
- package/src/data-structures/types/navigator.ts +1 -0
- package/src/data-structures/types/singly-linked-list.ts +1 -15
- package/src/data-structures/types/tree-multiset.ts +1 -1
- package/src/{data-structures → utils}/trampoline.ts +6 -6
- package/src/utils/types/index.ts +1 -0
- package/src/{data-structures → utils}/types/utils.ts +7 -0
- package/src/utils/utils.ts +12 -2
- package/tests/unit/data-structures/binary-tree/bst.test.ts +185 -0
- package/tests/unit/data-structures/graph/abstract-graph.ts +0 -0
- package/tests/unit/data-structures/graph/directed-graph.test.ts +71 -0
- package/tests/unit/data-structures/graph/index.ts +3 -0
- package/tests/unit/data-structures/graph/undirected-graph.ts +0 -0
- package/src/data-structures/graph/diagrams/adjacency-list-pros-cons.png +0 -0
- package/src/data-structures/graph/diagrams/adjacency-list.png +0 -0
- package/src/data-structures/graph/diagrams/adjacency-matrix-pros-cons.png +0 -0
- package/src/data-structures/graph/diagrams/adjacency-matrix.png +0 -0
- package/src/data-structures/graph/diagrams/dfs-can-do.png +0 -0
- package/src/data-structures/graph/diagrams/edge-list-pros-cons.png +0 -0
- package/src/data-structures/graph/diagrams/edge-list.png +0 -0
- package/src/data-structures/graph/diagrams/max-flow.png +0 -0
- package/src/data-structures/graph/diagrams/mst.png +0 -0
- /package/dist/{data-structures → utils}/trampoline.js +0 -0
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>SinglyLinkedList | data-structure-typed</title><meta name="description" content="Documentation for data-structure-typed"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container">
|
|
3
|
+
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
+
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
+
<div class="field">
|
|
6
|
+
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
+
<ul class="results">
|
|
8
|
+
<li class="state loading">Preparing search index...</li>
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">data-structure-typed</a></div>
|
|
10
|
+
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
+
<div class="container container-main">
|
|
12
|
+
<div class="col-content">
|
|
13
|
+
<div class="tsd-page-title">
|
|
14
|
+
<ul class="tsd-breadcrumb">
|
|
15
|
+
<li><a href="../modules.html">data-structure-typed</a></li>
|
|
16
|
+
<li><a href="SinglyLinkedList.html">SinglyLinkedList</a></li></ul>
|
|
17
|
+
<h1>Class SinglyLinkedList<NodeData></h1></div>
|
|
18
|
+
<section class="tsd-panel tsd-comment">
|
|
19
|
+
<div class="tsd-comment tsd-typography"><p>A doubly linked list</p>
|
|
20
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">listFromArray</span><span class="hl-1"> = </span><span class="hl-6">LinkedList</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">([</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">]);</span>
|
|
21
|
+
</code><button>Copy</button></pre>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="tsd-comment tsd-typography"></div></section>
|
|
24
|
+
<section class="tsd-panel">
|
|
25
|
+
<h4>Type Parameters</h4>
|
|
26
|
+
<ul class="tsd-type-parameter-list">
|
|
27
|
+
<li>
|
|
28
|
+
<h4><span class="tsd-kind-type-parameter">NodeData</span> = <span class="tsd-signature-type">any</span></h4></li></ul></section>
|
|
29
|
+
<section class="tsd-panel tsd-hierarchy">
|
|
30
|
+
<h4>Hierarchy</h4>
|
|
31
|
+
<ul class="tsd-hierarchy">
|
|
32
|
+
<li><span class="target">SinglyLinkedList</span></li></ul></section><aside class="tsd-sources">
|
|
33
|
+
<ul>
|
|
34
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L96">src/data-structures/linked-list/singly-linked-list.ts:96</a></li></ul></aside>
|
|
35
|
+
<section class="tsd-panel-group tsd-index-group">
|
|
36
|
+
<section class="tsd-panel tsd-index-panel">
|
|
37
|
+
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
38
|
+
<h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
|
|
39
|
+
<div class="tsd-accordion-details">
|
|
40
|
+
<section class="tsd-index-section">
|
|
41
|
+
<h3 class="tsd-index-heading">Constructors</h3>
|
|
42
|
+
<div class="tsd-index-list"><a href="SinglyLinkedList.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>constructor</span></a>
|
|
43
|
+
</div></section>
|
|
44
|
+
<section class="tsd-index-section">
|
|
45
|
+
<h3 class="tsd-index-heading">Properties</h3>
|
|
46
|
+
<div class="tsd-index-list"><a href="SinglyLinkedList.html#head" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>head</span></a>
|
|
47
|
+
<a href="SinglyLinkedList.html#size" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>size</span></a>
|
|
48
|
+
<a href="SinglyLinkedList.html#tail" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tail</span></a>
|
|
49
|
+
</div></section>
|
|
50
|
+
<section class="tsd-index-section">
|
|
51
|
+
<h3 class="tsd-index-heading">Accessors</h3>
|
|
52
|
+
<div class="tsd-index-list"><a href="SinglyLinkedList.html#length" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-262144"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g></svg><span>length</span></a>
|
|
53
|
+
</div></section>
|
|
54
|
+
<section class="tsd-index-section">
|
|
55
|
+
<h3 class="tsd-index-heading">Methods</h3>
|
|
56
|
+
<div class="tsd-index-list"><a href="SinglyLinkedList.html#_iterator_" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g></svg><span>[iterator]</span></a>
|
|
57
|
+
<a href="SinglyLinkedList.html#append" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>append</span></a>
|
|
58
|
+
<a href="SinglyLinkedList.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>clear</span></a>
|
|
59
|
+
<a href="SinglyLinkedList.html#filter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>filter</span></a>
|
|
60
|
+
<a href="SinglyLinkedList.html#find" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find</span></a>
|
|
61
|
+
<a href="SinglyLinkedList.html#findIndex" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Index</span></a>
|
|
62
|
+
<a href="SinglyLinkedList.html#findNode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Node</span></a>
|
|
63
|
+
<a href="SinglyLinkedList.html#findNodeIndex" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Node<wbr/>Index</span></a>
|
|
64
|
+
<a href="SinglyLinkedList.html#forEach" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>for<wbr/>Each</span></a>
|
|
65
|
+
<a href="SinglyLinkedList.html#get" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get</span></a>
|
|
66
|
+
<a href="SinglyLinkedList.html#getNode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Node</span></a>
|
|
67
|
+
<a href="SinglyLinkedList.html#insertAfter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>After</span></a>
|
|
68
|
+
<a href="SinglyLinkedList.html#insertAt" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>At</span></a>
|
|
69
|
+
<a href="SinglyLinkedList.html#insertBefore" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>Before</span></a>
|
|
70
|
+
<a href="SinglyLinkedList.html#map" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>map</span></a>
|
|
71
|
+
<a href="SinglyLinkedList.html#merge" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>merge</span></a>
|
|
72
|
+
<a href="SinglyLinkedList.html#pop" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>pop</span></a>
|
|
73
|
+
<a href="SinglyLinkedList.html#prepend" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend</span></a>
|
|
74
|
+
<a href="SinglyLinkedList.html#push" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>push</span></a>
|
|
75
|
+
<a href="SinglyLinkedList.html#reduce" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>reduce</span></a>
|
|
76
|
+
<a href="SinglyLinkedList.html#removeAt" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>At</span></a>
|
|
77
|
+
<a href="SinglyLinkedList.html#removeFromAnyEnd" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>From<wbr/>Any<wbr/>End</span></a>
|
|
78
|
+
<a href="SinglyLinkedList.html#removeNode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Node</span></a>
|
|
79
|
+
<a href="SinglyLinkedList.html#reverse" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>reverse</span></a>
|
|
80
|
+
<a href="SinglyLinkedList.html#shift" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>shift</span></a>
|
|
81
|
+
<a href="SinglyLinkedList.html#slice" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>slice</span></a>
|
|
82
|
+
<a href="SinglyLinkedList.html#sort" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>sort</span></a>
|
|
83
|
+
<a href="SinglyLinkedList.html#toArray" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>to<wbr/>Array</span></a>
|
|
84
|
+
<a href="SinglyLinkedList.html#toString" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>to<wbr/>String</span></a>
|
|
85
|
+
<a href="SinglyLinkedList.html#from" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>from</span></a>
|
|
86
|
+
</div></section></div></details></section></section>
|
|
87
|
+
<section class="tsd-panel-group tsd-member-group">
|
|
88
|
+
<h2>Constructors</h2>
|
|
89
|
+
<section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a>
|
|
90
|
+
<h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></h3>
|
|
91
|
+
<ul class="tsd-signatures">
|
|
92
|
+
<li class="tsd-signature tsd-anchor-link" id="constructor.new_SinglyLinkedList"><span class="tsd-kind-constructor-signature">new <wbr/>Singly<wbr/>Linked<wbr/>List</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#constructor.new_SinglyLinkedList" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
93
|
+
<li class="tsd-description">
|
|
94
|
+
<section class="tsd-panel">
|
|
95
|
+
<h4>Type Parameters</h4>
|
|
96
|
+
<ul class="tsd-type-parameter-list">
|
|
97
|
+
<li>
|
|
98
|
+
<h4><span class="tsd-kind-type-parameter">NodeData</span> = <span class="tsd-signature-type">any</span></h4></li></ul></section>
|
|
99
|
+
<div class="tsd-parameters">
|
|
100
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
101
|
+
<ul class="tsd-parameter-list">
|
|
102
|
+
<li>
|
|
103
|
+
<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
|
|
104
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
105
|
+
<ul>
|
|
106
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L105">src/data-structures/linked-list/singly-linked-list.ts:105</a></li></ul></aside></li></ul></section></section>
|
|
107
|
+
<section class="tsd-panel-group tsd-member-group">
|
|
108
|
+
<h2>Properties</h2>
|
|
109
|
+
<section class="tsd-panel tsd-member"><a id="head" class="tsd-anchor"></a>
|
|
110
|
+
<h3 class="tsd-anchor-link"><span>head</span><a href="#head" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
111
|
+
<div class="tsd-signature"><span class="tsd-kind-property">head</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></div>
|
|
112
|
+
<div class="tsd-comment tsd-typography"><p>The head of the list, the first node</p>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
115
|
+
<ul>
|
|
116
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L99">src/data-structures/linked-list/singly-linked-list.ts:99</a></li></ul></aside></section>
|
|
117
|
+
<section class="tsd-panel tsd-member tsd-is-private"><a id="size" class="tsd-anchor"></a>
|
|
118
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>size</span><a href="#size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
119
|
+
<div class="tsd-signature"><span class="tsd-kind-property">size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
120
|
+
<div class="tsd-comment tsd-typography"><p>Internal size reference</p>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
123
|
+
<ul>
|
|
124
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L103">src/data-structures/linked-list/singly-linked-list.ts:103</a></li></ul></aside></section>
|
|
125
|
+
<section class="tsd-panel tsd-member"><a id="tail" class="tsd-anchor"></a>
|
|
126
|
+
<h3 class="tsd-anchor-link"><span>tail</span><a href="#tail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
127
|
+
<div class="tsd-signature"><span class="tsd-kind-property">tail</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></div>
|
|
128
|
+
<div class="tsd-comment tsd-typography"><p>The tail of the list, the last node</p>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
131
|
+
<ul>
|
|
132
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L101">src/data-structures/linked-list/singly-linked-list.ts:101</a></li></ul></aside></section></section>
|
|
133
|
+
<section class="tsd-panel-group tsd-member-group">
|
|
134
|
+
<h2>Accessors</h2>
|
|
135
|
+
<section class="tsd-panel tsd-member"><a id="length" class="tsd-anchor"></a>
|
|
136
|
+
<h3 class="tsd-anchor-link"><span>length</span><a href="#length" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
137
|
+
<ul class="tsd-signatures">
|
|
138
|
+
<li class="tsd-signature" id="length.length-1"><span class="tsd-signature-symbol">get</span> length<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
|
|
139
|
+
<li class="tsd-description">
|
|
140
|
+
<div class="tsd-comment tsd-typography"><p>The length of the list</p>
|
|
141
|
+
</div>
|
|
142
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
|
143
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
144
|
+
<ul>
|
|
145
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L118">src/data-structures/linked-list/singly-linked-list.ts:118</a></li></ul></aside></li></ul></section></section>
|
|
146
|
+
<section class="tsd-panel-group tsd-member-group">
|
|
147
|
+
<h2>Methods</h2>
|
|
148
|
+
<section class="tsd-panel tsd-member"><a id="_iterator_" class="tsd-anchor"></a>
|
|
149
|
+
<h3 class="tsd-anchor-link"><span>[iterator]</span><a href="#_iterator_" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
150
|
+
<ul class="tsd-signatures">
|
|
151
|
+
<li class="tsd-signature tsd-anchor-link" id="_iterator_._iterator_-1"><span class="tsd-kind-call-signature">[iterator]</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">IterableIterator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#_iterator_._iterator_-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
152
|
+
<li class="tsd-description">
|
|
153
|
+
<div class="tsd-comment tsd-typography"><p>The iterator implementation</p>
|
|
154
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-7">for</span><span class="hl-1"> (</span><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">val</span><span class="hl-1"> </span><span class="hl-3">of</span><span class="hl-1"> </span><span class="hl-6">list</span><span class="hl-1">) { </span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1">); } </span><span class="hl-8">// 1 2 3</span>
|
|
155
|
+
</code><button>Copy</button></pre>
|
|
156
|
+
</div>
|
|
157
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">IterableIterator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
158
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
159
|
+
<ul>
|
|
160
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L754">src/data-structures/linked-list/singly-linked-list.ts:754</a></li></ul></aside></li></ul></section>
|
|
161
|
+
<section class="tsd-panel tsd-member"><a id="append" class="tsd-anchor"></a>
|
|
162
|
+
<h3 class="tsd-anchor-link"><span>append</span><a href="#append" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
163
|
+
<ul class="tsd-signatures">
|
|
164
|
+
<li class="tsd-signature tsd-anchor-link" id="append.append-1"><span class="tsd-kind-call-signature">append</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#append.append-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
165
|
+
<li class="tsd-description">
|
|
166
|
+
<div class="tsd-comment tsd-typography"><p>Append one or any number of nodes to the end of the list.
|
|
167
|
+
This modifies the list in place and returns the list itself
|
|
168
|
+
to make this method chainable.</p>
|
|
169
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">).</span><span class="hl-0">append</span><span class="hl-1">(</span><span class="hl-5">2</span><span class="hl-1">).</span><span class="hl-0">append</span><span class="hl-1">(</span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">4</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3 <=> 4</span>
|
|
170
|
+
</code><button>Copy</button></pre>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="tsd-parameters">
|
|
173
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
174
|
+
<ul class="tsd-parameter-list">
|
|
175
|
+
<li>
|
|
176
|
+
<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span></h5>
|
|
177
|
+
<div class="tsd-comment tsd-typography"><p>Data to be stored in the node, takes any number of arguments</p>
|
|
178
|
+
</div>
|
|
179
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
180
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
181
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
182
|
+
<ul>
|
|
183
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L263">src/data-structures/linked-list/singly-linked-list.ts:263</a></li></ul></aside></li></ul></section>
|
|
184
|
+
<section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a>
|
|
185
|
+
<h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
186
|
+
<ul class="tsd-signatures">
|
|
187
|
+
<li class="tsd-signature tsd-anchor-link" id="clear.clear-1"><span class="tsd-kind-call-signature">clear</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#clear.clear-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
188
|
+
<li class="tsd-description">
|
|
189
|
+
<div class="tsd-comment tsd-typography"><p>Removes all nodes from a list</p>
|
|
190
|
+
<pre><code class="language-ts"><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">clear</span><span class="hl-1">();</span>
|
|
191
|
+
</code><button>Copy</button></pre>
|
|
192
|
+
</div>
|
|
193
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
194
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
195
|
+
<ul>
|
|
196
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L555">src/data-structures/linked-list/singly-linked-list.ts:555</a></li></ul></aside></li></ul></section>
|
|
197
|
+
<section class="tsd-panel tsd-member"><a id="filter" class="tsd-anchor"></a>
|
|
198
|
+
<h3 class="tsd-anchor-link"><span>filter</span><a href="#filter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
199
|
+
<ul class="tsd-signatures">
|
|
200
|
+
<li class="tsd-signature tsd-anchor-link" id="filter.filter-1"><span class="tsd-kind-call-signature">filter</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span>, <span class="tsd-kind-parameter">reverse</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#filter.filter-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
201
|
+
<li class="tsd-description">
|
|
202
|
+
<div class="tsd-comment tsd-typography"><p>The filter() method creates a new list with all nodes
|
|
203
|
+
that pass the test implemented by the provided function.</p>
|
|
204
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">4</span><span class="hl-1">, </span><span class="hl-5">5</span><span class="hl-1">).</span><span class="hl-0">filter</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> < </span><span class="hl-5">4</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3</span>
|
|
205
|
+
</code><button>Copy</button></pre>
|
|
206
|
+
</div>
|
|
207
|
+
<div class="tsd-parameters">
|
|
208
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
209
|
+
<ul class="tsd-parameter-list">
|
|
210
|
+
<li>
|
|
211
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
212
|
+
<div class="tsd-comment tsd-typography"><p>Function to test each node val in the list. Return true to keep the node</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
215
|
+
<ul class="tsd-parameters">
|
|
216
|
+
<li class="tsd-parameter-signature">
|
|
217
|
+
<ul class="tsd-signatures">
|
|
218
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
219
|
+
<li class="tsd-description">
|
|
220
|
+
<div class="tsd-parameters">
|
|
221
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
222
|
+
<ul class="tsd-parameter-list">
|
|
223
|
+
<li>
|
|
224
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
225
|
+
<li>
|
|
226
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
227
|
+
<li>
|
|
228
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
229
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li>
|
|
230
|
+
<li>
|
|
231
|
+
<h5><span class="tsd-kind-parameter">reverse</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5>
|
|
232
|
+
<div class="tsd-comment tsd-typography"><p>Indicates if the list should be filtered in reverse order, default is false</p>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
235
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
236
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
237
|
+
<ul>
|
|
238
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L669">src/data-structures/linked-list/singly-linked-list.ts:669</a></li></ul></aside></li></ul></section>
|
|
239
|
+
<section class="tsd-panel tsd-member"><a id="find" class="tsd-anchor"></a>
|
|
240
|
+
<h3 class="tsd-anchor-link"><span>find</span><a href="#find" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
241
|
+
<ul class="tsd-signatures">
|
|
242
|
+
<li class="tsd-signature tsd-anchor-link" id="find.find-1"><span class="tsd-kind-call-signature">find</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><a href="#find.find-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
243
|
+
<li class="tsd-description">
|
|
244
|
+
<div class="tsd-comment tsd-typography"><p>Returns the value of the first element in the list that
|
|
245
|
+
satisfies the provided testing function. Otherwise undefined is returned.</p>
|
|
246
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">find</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> === </span><span class="hl-5">1</span><span class="hl-1">); </span><span class="hl-8">// 1</span>
|
|
247
|
+
</code><button>Copy</button></pre>
|
|
248
|
+
</div>
|
|
249
|
+
<div class="tsd-parameters">
|
|
250
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
251
|
+
<ul class="tsd-parameter-list">
|
|
252
|
+
<li>
|
|
253
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
254
|
+
<div class="tsd-comment tsd-typography"><p>Function to test val against</p>
|
|
255
|
+
</div>
|
|
256
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
257
|
+
<ul class="tsd-parameters">
|
|
258
|
+
<li class="tsd-parameter-signature">
|
|
259
|
+
<ul class="tsd-signatures">
|
|
260
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
261
|
+
<li class="tsd-description">
|
|
262
|
+
<div class="tsd-parameters">
|
|
263
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
264
|
+
<ul class="tsd-parameter-list">
|
|
265
|
+
<li>
|
|
266
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
267
|
+
<li>
|
|
268
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
269
|
+
<li>
|
|
270
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
271
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div>
|
|
272
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h4>
|
|
273
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
274
|
+
<ul>
|
|
275
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L228">src/data-structures/linked-list/singly-linked-list.ts:228</a></li></ul></aside></li></ul></section>
|
|
276
|
+
<section class="tsd-panel tsd-member"><a id="findIndex" class="tsd-anchor"></a>
|
|
277
|
+
<h3 class="tsd-anchor-link"><span>find<wbr/>Index</span><a href="#findIndex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
278
|
+
<ul class="tsd-signatures">
|
|
279
|
+
<li class="tsd-signature tsd-anchor-link" id="findIndex.findIndex-1"><span class="tsd-kind-call-signature">find<wbr/>Index</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#findIndex.findIndex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
280
|
+
<li class="tsd-description">
|
|
281
|
+
<div class="tsd-comment tsd-typography"><p>Returns the index of the first node in the list that
|
|
282
|
+
satisfies the provided testing function. Ohterwise -1 is returned.</p>
|
|
283
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">findIndex</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> === </span><span class="hl-5">3</span><span class="hl-1">); </span><span class="hl-8">// 2</span>
|
|
284
|
+
</code><button>Copy</button></pre>
|
|
285
|
+
</div>
|
|
286
|
+
<div class="tsd-parameters">
|
|
287
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
288
|
+
<ul class="tsd-parameter-list">
|
|
289
|
+
<li>
|
|
290
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
291
|
+
<div class="tsd-comment tsd-typography"><p>Function to test val against</p>
|
|
292
|
+
</div>
|
|
293
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
294
|
+
<ul class="tsd-parameters">
|
|
295
|
+
<li class="tsd-parameter-signature">
|
|
296
|
+
<ul class="tsd-signatures">
|
|
297
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
298
|
+
<li class="tsd-description">
|
|
299
|
+
<div class="tsd-parameters">
|
|
300
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
301
|
+
<ul class="tsd-parameter-list">
|
|
302
|
+
<li>
|
|
303
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
304
|
+
<li>
|
|
305
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
306
|
+
<li>
|
|
307
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
308
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div>
|
|
309
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
|
310
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
311
|
+
<ul>
|
|
312
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L245">src/data-structures/linked-list/singly-linked-list.ts:245</a></li></ul></aside></li></ul></section>
|
|
313
|
+
<section class="tsd-panel tsd-member"><a id="findNode" class="tsd-anchor"></a>
|
|
314
|
+
<h3 class="tsd-anchor-link"><span>find<wbr/>Node</span><a href="#findNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
315
|
+
<ul class="tsd-signatures">
|
|
316
|
+
<li class="tsd-signature tsd-anchor-link" id="findNode.findNode-1"><span class="tsd-kind-call-signature">find<wbr/>Node</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#findNode.findNode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
317
|
+
<li class="tsd-description">
|
|
318
|
+
<div class="tsd-comment tsd-typography"><p>Returns the first node in the list that
|
|
319
|
+
satisfies the provided testing function. Otherwise undefined is returned.</p>
|
|
320
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">findNode</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> === </span><span class="hl-5">1</span><span class="hl-1">);</span><br/><span class="hl-8">// { prev: null, val: 1, next: SinglyLinkedListNode }</span>
|
|
321
|
+
</code><button>Copy</button></pre>
|
|
322
|
+
</div>
|
|
323
|
+
<div class="tsd-parameters">
|
|
324
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
325
|
+
<ul class="tsd-parameter-list">
|
|
326
|
+
<li>
|
|
327
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
328
|
+
<div class="tsd-comment tsd-typography"><p>Function to test val against</p>
|
|
329
|
+
</div>
|
|
330
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
331
|
+
<ul class="tsd-parameters">
|
|
332
|
+
<li class="tsd-parameter-signature">
|
|
333
|
+
<ul class="tsd-signatures">
|
|
334
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
335
|
+
<li class="tsd-description">
|
|
336
|
+
<div class="tsd-parameters">
|
|
337
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
338
|
+
<ul class="tsd-parameter-list">
|
|
339
|
+
<li>
|
|
340
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
341
|
+
<li>
|
|
342
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
343
|
+
<li>
|
|
344
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
345
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div>
|
|
346
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
347
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
348
|
+
<ul>
|
|
349
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L211">src/data-structures/linked-list/singly-linked-list.ts:211</a></li></ul></aside></li></ul></section>
|
|
350
|
+
<section class="tsd-panel tsd-member"><a id="findNodeIndex" class="tsd-anchor"></a>
|
|
351
|
+
<h3 class="tsd-anchor-link"><span>find<wbr/>Node<wbr/>Index</span><a href="#findNodeIndex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
352
|
+
<ul class="tsd-signatures">
|
|
353
|
+
<li class="tsd-signature tsd-anchor-link" id="findNodeIndex.findNodeIndex-1"><span class="tsd-kind-call-signature">find<wbr/>Node<wbr/>Index</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">index</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">node</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><a href="#findNodeIndex.findNodeIndex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
354
|
+
<li class="tsd-description">
|
|
355
|
+
<div class="tsd-comment tsd-typography"><p>Return the first node and its index in the list that
|
|
356
|
+
satisfies the testing function</p>
|
|
357
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">findNodeIndex</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> === </span><span class="hl-5">1</span><span class="hl-1">);</span><br/><span class="hl-8">// { node: SinglyLinkedListNode, index: 0 }</span>
|
|
358
|
+
</code><button>Copy</button></pre>
|
|
359
|
+
</div>
|
|
360
|
+
<div class="tsd-parameters">
|
|
361
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
362
|
+
<ul class="tsd-parameter-list">
|
|
363
|
+
<li>
|
|
364
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
365
|
+
<div class="tsd-comment tsd-typography"><p>A function to be applied to the val of each node</p>
|
|
366
|
+
</div>
|
|
367
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
368
|
+
<ul class="tsd-parameters">
|
|
369
|
+
<li class="tsd-parameter-signature">
|
|
370
|
+
<ul class="tsd-signatures">
|
|
371
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
372
|
+
<li class="tsd-description">
|
|
373
|
+
<div class="tsd-parameters">
|
|
374
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
375
|
+
<ul class="tsd-parameter-list">
|
|
376
|
+
<li>
|
|
377
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
378
|
+
<li>
|
|
379
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
380
|
+
<li>
|
|
381
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
382
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div>
|
|
383
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">index</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">node</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></h4>
|
|
384
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
385
|
+
<ul>
|
|
386
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L179">src/data-structures/linked-list/singly-linked-list.ts:179</a></li></ul></aside></li></ul></section>
|
|
387
|
+
<section class="tsd-panel tsd-member"><a id="forEach" class="tsd-anchor"></a>
|
|
388
|
+
<h3 class="tsd-anchor-link"><span>for<wbr/>Each</span><a href="#forEach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
389
|
+
<ul class="tsd-signatures">
|
|
390
|
+
<li class="tsd-signature tsd-anchor-link" id="forEach.forEach-1"><span class="tsd-kind-call-signature">for<wbr/>Each</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span>, <span class="tsd-kind-parameter">reverse</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#forEach.forEach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
391
|
+
<li class="tsd-description">
|
|
392
|
+
<div class="tsd-comment tsd-typography"><p>The forEach() method executes a provided function once for each list node.</p>
|
|
393
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">forEach</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1">)); </span><span class="hl-8">// 1 2 3</span>
|
|
394
|
+
</code><button>Copy</button></pre>
|
|
395
|
+
</div>
|
|
396
|
+
<div class="tsd-parameters">
|
|
397
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
398
|
+
<ul class="tsd-parameter-list">
|
|
399
|
+
<li>
|
|
400
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span></h5>
|
|
401
|
+
<div class="tsd-comment tsd-typography"><p>Function to execute for each element, taking up to three arguments.</p>
|
|
402
|
+
</div>
|
|
403
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
404
|
+
<ul class="tsd-parameters">
|
|
405
|
+
<li class="tsd-parameter-signature">
|
|
406
|
+
<ul class="tsd-signatures">
|
|
407
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
408
|
+
<li class="tsd-description">
|
|
409
|
+
<div class="tsd-parameters">
|
|
410
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
411
|
+
<ul class="tsd-parameter-list">
|
|
412
|
+
<li>
|
|
413
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type">any</span></h5></li>
|
|
414
|
+
<li>
|
|
415
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
416
|
+
<li>
|
|
417
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
418
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4></li></ul></li></ul></li>
|
|
419
|
+
<li>
|
|
420
|
+
<h5><span class="tsd-kind-parameter">reverse</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5>
|
|
421
|
+
<div class="tsd-comment tsd-typography"><p>Indicates if the list should be walked in reverse order, default is false</p>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
424
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
425
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
426
|
+
<ul>
|
|
427
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L623">src/data-structures/linked-list/singly-linked-list.ts:623</a></li></ul></aside></li></ul></section>
|
|
428
|
+
<section class="tsd-panel tsd-member"><a id="get" class="tsd-anchor"></a>
|
|
429
|
+
<h3 class="tsd-anchor-link"><span>get</span><a href="#get" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
430
|
+
<ul class="tsd-signatures">
|
|
431
|
+
<li class="tsd-signature tsd-anchor-link" id="get.get-1"><span class="tsd-kind-call-signature">get</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">index</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><a href="#get.get-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
432
|
+
<li class="tsd-description">
|
|
433
|
+
<div class="tsd-comment tsd-typography"><p>Get the node val at a specified index, zero based</p>
|
|
434
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">get</span><span class="hl-1">(</span><span class="hl-5">0</span><span class="hl-1">); </span><span class="hl-8">// 1</span>
|
|
435
|
+
</code><button>Copy</button></pre>
|
|
436
|
+
</div>
|
|
437
|
+
<div class="tsd-parameters">
|
|
438
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
439
|
+
<ul class="tsd-parameter-list">
|
|
440
|
+
<li>
|
|
441
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5>
|
|
442
|
+
<div class="tsd-comment tsd-typography"><p>to retrieve val at</p>
|
|
443
|
+
</div>
|
|
444
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
445
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h4>
|
|
446
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
447
|
+
<ul>
|
|
448
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L141">src/data-structures/linked-list/singly-linked-list.ts:141</a></li></ul></aside></li></ul></section>
|
|
449
|
+
<section class="tsd-panel tsd-member"><a id="getNode" class="tsd-anchor"></a>
|
|
450
|
+
<h3 class="tsd-anchor-link"><span>get<wbr/>Node</span><a href="#getNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
451
|
+
<ul class="tsd-signatures">
|
|
452
|
+
<li class="tsd-signature tsd-anchor-link" id="getNode.getNode-1"><span class="tsd-kind-call-signature">get<wbr/>Node</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">index</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#getNode.getNode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
453
|
+
<li class="tsd-description">
|
|
454
|
+
<div class="tsd-comment tsd-typography"><p>Get the node at index, zero based</p>
|
|
455
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">getNode</span><span class="hl-1">(</span><span class="hl-5">0</span><span class="hl-1">);</span><br/><span class="hl-8">// { prev: null, val: 1, next: SinglyLinkedListNode }</span>
|
|
456
|
+
</code><button>Copy</button></pre>
|
|
457
|
+
</div>
|
|
458
|
+
<div class="tsd-parameters">
|
|
459
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
460
|
+
<ul class="tsd-parameter-list">
|
|
461
|
+
<li>
|
|
462
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li></ul></div>
|
|
463
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
464
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
465
|
+
<ul>
|
|
466
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L153">src/data-structures/linked-list/singly-linked-list.ts:153</a></li></ul></aside></li></ul></section>
|
|
467
|
+
<section class="tsd-panel tsd-member"><a id="insertAfter" class="tsd-anchor"></a>
|
|
468
|
+
<h3 class="tsd-anchor-link"><span>insert<wbr/>After</span><a href="#insertAfter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
469
|
+
<ul class="tsd-signatures">
|
|
470
|
+
<li class="tsd-signature tsd-anchor-link" id="insertAfter.insertAfter-1"><span class="tsd-kind-call-signature">insert<wbr/>After</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">referenceNode</span>, <span class="tsd-kind-parameter">val</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#insertAfter.insertAfter-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
471
|
+
<li class="tsd-description">
|
|
472
|
+
<div class="tsd-comment tsd-typography"><p>Insert a new node after this one</p>
|
|
473
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">insertAfter</span><span class="hl-1">(</span><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-6">head</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3</span>
|
|
474
|
+
</code><button>Copy</button></pre>
|
|
475
|
+
</div>
|
|
476
|
+
<div class="tsd-parameters">
|
|
477
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
478
|
+
<ul class="tsd-parameter-list">
|
|
479
|
+
<li>
|
|
480
|
+
<h5><span class="tsd-kind-parameter">referenceNode</span>: <a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5>
|
|
481
|
+
<div class="tsd-comment tsd-typography"><p>The reference node</p>
|
|
482
|
+
</div>
|
|
483
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
484
|
+
<li>
|
|
485
|
+
<h5><span class="tsd-kind-parameter">val</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5>
|
|
486
|
+
<div class="tsd-comment tsd-typography"><p>Data to be saved in the node</p>
|
|
487
|
+
</div>
|
|
488
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
489
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
490
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
491
|
+
<ul>
|
|
492
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L484">src/data-structures/linked-list/singly-linked-list.ts:484</a></li></ul></aside></li></ul></section>
|
|
493
|
+
<section class="tsd-panel tsd-member"><a id="insertAt" class="tsd-anchor"></a>
|
|
494
|
+
<h3 class="tsd-anchor-link"><span>insert<wbr/>At</span><a href="#insertAt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
495
|
+
<ul class="tsd-signatures">
|
|
496
|
+
<li class="tsd-signature tsd-anchor-link" id="insertAt.insertAt-1"><span class="tsd-kind-call-signature">insert<wbr/>At</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">val</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#insertAt.insertAt-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
497
|
+
<li class="tsd-description">
|
|
498
|
+
<div class="tsd-comment tsd-typography"><p>Insert a new node at a given index position. If index is
|
|
499
|
+
out of bounds, the node is appended, if index is negative
|
|
500
|
+
or 0, it will be prepended.</p>
|
|
501
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">insertAt</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3</span>
|
|
502
|
+
</code><button>Copy</button></pre>
|
|
503
|
+
</div>
|
|
504
|
+
<div class="tsd-parameters">
|
|
505
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
506
|
+
<ul class="tsd-parameter-list">
|
|
507
|
+
<li>
|
|
508
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5>
|
|
509
|
+
<div class="tsd-comment tsd-typography"><p>The index to insert the new node at</p>
|
|
510
|
+
</div>
|
|
511
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
512
|
+
<li>
|
|
513
|
+
<h5><span class="tsd-kind-parameter">val</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5>
|
|
514
|
+
<div class="tsd-comment tsd-typography"><p>Data to be stored on the new node</p>
|
|
515
|
+
</div>
|
|
516
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
517
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
518
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
519
|
+
<ul>
|
|
520
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L324">src/data-structures/linked-list/singly-linked-list.ts:324</a></li></ul></aside></li></ul></section>
|
|
521
|
+
<section class="tsd-panel tsd-member"><a id="insertBefore" class="tsd-anchor"></a>
|
|
522
|
+
<h3 class="tsd-anchor-link"><span>insert<wbr/>Before</span><a href="#insertBefore" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
523
|
+
<ul class="tsd-signatures">
|
|
524
|
+
<li class="tsd-signature tsd-anchor-link" id="insertBefore.insertBefore-1"><span class="tsd-kind-call-signature">insert<wbr/>Before</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">referenceNode</span>, <span class="tsd-kind-parameter">val</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#insertBefore.insertBefore-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
525
|
+
<li class="tsd-description">
|
|
526
|
+
<div class="tsd-comment tsd-typography"><p>Insert a new node before the reference node</p>
|
|
527
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">insertBefore</span><span class="hl-1">(</span><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-6">tail</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3</span>
|
|
528
|
+
</code><button>Copy</button></pre>
|
|
529
|
+
</div>
|
|
530
|
+
<div class="tsd-parameters">
|
|
531
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
532
|
+
<ul class="tsd-parameter-list">
|
|
533
|
+
<li>
|
|
534
|
+
<h5><span class="tsd-kind-parameter">referenceNode</span>: <a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5>
|
|
535
|
+
<div class="tsd-comment tsd-typography"><p>The node reference</p>
|
|
536
|
+
</div>
|
|
537
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
538
|
+
<li>
|
|
539
|
+
<h5><span class="tsd-kind-parameter">val</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5>
|
|
540
|
+
<div class="tsd-comment tsd-typography"><p>Data to save in the node</p>
|
|
541
|
+
</div>
|
|
542
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
543
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
544
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
545
|
+
<ul>
|
|
546
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L400">src/data-structures/linked-list/singly-linked-list.ts:400</a></li></ul></aside></li></ul></section>
|
|
547
|
+
<section class="tsd-panel tsd-member"><a id="map" class="tsd-anchor"></a>
|
|
548
|
+
<h3 class="tsd-anchor-link"><span>map</span><a href="#map" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
549
|
+
<ul class="tsd-signatures">
|
|
550
|
+
<li class="tsd-signature tsd-anchor-link" id="map.map-1"><span class="tsd-kind-call-signature">map</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span>, <span class="tsd-kind-parameter">reverse</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#map.map-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
551
|
+
<li class="tsd-description">
|
|
552
|
+
<div class="tsd-comment tsd-typography"><p>The map() method creates a new list with the results of
|
|
553
|
+
calling a provided function on every node in the calling list.</p>
|
|
554
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">map</span><span class="hl-1">(</span><span class="hl-6">val</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">val</span><span class="hl-1"> + </span><span class="hl-5">10</span><span class="hl-1">); </span><span class="hl-8">// 11 <=> 12 <=> 13</span>
|
|
555
|
+
</code><button>Copy</button></pre>
|
|
556
|
+
</div>
|
|
557
|
+
<div class="tsd-parameters">
|
|
558
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
559
|
+
<ul class="tsd-parameter-list">
|
|
560
|
+
<li>
|
|
561
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span></h5>
|
|
562
|
+
<div class="tsd-comment tsd-typography"><p>Function that produces an node of the new list, taking up to three arguments</p>
|
|
563
|
+
</div>
|
|
564
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
565
|
+
<ul class="tsd-parameters">
|
|
566
|
+
<li class="tsd-parameter-signature">
|
|
567
|
+
<ul class="tsd-signatures">
|
|
568
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">data</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
569
|
+
<li class="tsd-description">
|
|
570
|
+
<div class="tsd-parameters">
|
|
571
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
572
|
+
<ul class="tsd-parameter-list">
|
|
573
|
+
<li>
|
|
574
|
+
<h5><span class="tsd-kind-parameter">data</span>: <span class="tsd-signature-type">any</span></h5></li>
|
|
575
|
+
<li>
|
|
576
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
577
|
+
<li>
|
|
578
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
579
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4></li></ul></li></ul></li>
|
|
580
|
+
<li>
|
|
581
|
+
<h5><span class="tsd-kind-parameter">reverse</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5>
|
|
582
|
+
<div class="tsd-comment tsd-typography"><p>Indicates if the list should be mapped in reverse order, default is false</p>
|
|
583
|
+
</div>
|
|
584
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
585
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
586
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
587
|
+
<ul>
|
|
588
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L649">src/data-structures/linked-list/singly-linked-list.ts:649</a></li></ul></aside></li></ul></section>
|
|
589
|
+
<section class="tsd-panel tsd-member"><a id="merge" class="tsd-anchor"></a>
|
|
590
|
+
<h3 class="tsd-anchor-link"><span>merge</span><a href="#merge" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
591
|
+
<ul class="tsd-signatures">
|
|
592
|
+
<li class="tsd-signature tsd-anchor-link" id="merge.merge-1"><span class="tsd-kind-call-signature">merge</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#merge.merge-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
593
|
+
<li class="tsd-description">
|
|
594
|
+
<div class="tsd-comment tsd-typography"><p>Merge the current list with another. Both lists will be
|
|
595
|
+
equal after merging.</p>
|
|
596
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">otherList</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">merge</span><span class="hl-1">(</span><span class="hl-6">otherList</span><span class="hl-1">);</span><br/><span class="hl-1">(</span><span class="hl-6">list</span><span class="hl-1"> === </span><span class="hl-6">otherList</span><span class="hl-1">); </span><span class="hl-8">// true</span>
|
|
597
|
+
</code><button>Copy</button></pre>
|
|
598
|
+
</div>
|
|
599
|
+
<div class="tsd-parameters">
|
|
600
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
601
|
+
<ul class="tsd-parameter-list">
|
|
602
|
+
<li>
|
|
603
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5>
|
|
604
|
+
<div class="tsd-comment tsd-typography"><p>The list to be merged</p>
|
|
605
|
+
</div>
|
|
606
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
607
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
608
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
609
|
+
<ul>
|
|
610
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L533">src/data-structures/linked-list/singly-linked-list.ts:533</a></li></ul></aside></li></ul></section>
|
|
611
|
+
<section class="tsd-panel tsd-member"><a id="pop" class="tsd-anchor"></a>
|
|
612
|
+
<h3 class="tsd-anchor-link"><span>pop</span><a href="#pop" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
613
|
+
<ul class="tsd-signatures">
|
|
614
|
+
<li class="tsd-signature tsd-anchor-link" id="pop.pop-1"><span class="tsd-kind-call-signature">pop</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><a href="#pop.pop-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
615
|
+
<li class="tsd-description">
|
|
616
|
+
<div class="tsd-comment tsd-typography"><p>Remove the last node from the list and return the val of the removed node
|
|
617
|
+
or undefined if the list was empty</p>
|
|
618
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">pop</span><span class="hl-1">(); </span><span class="hl-8">// 3</span>
|
|
619
|
+
</code><button>Copy</button></pre>
|
|
620
|
+
</div>
|
|
621
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h4>
|
|
622
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
623
|
+
<ul>
|
|
624
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L518">src/data-structures/linked-list/singly-linked-list.ts:518</a></li></ul></aside></li></ul></section>
|
|
625
|
+
<section class="tsd-panel tsd-member"><a id="prepend" class="tsd-anchor"></a>
|
|
626
|
+
<h3 class="tsd-anchor-link"><span>prepend</span><a href="#prepend" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
627
|
+
<ul class="tsd-signatures">
|
|
628
|
+
<li class="tsd-signature tsd-anchor-link" id="prepend.prepend-1"><span class="tsd-kind-call-signature">prepend</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#prepend.prepend-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
629
|
+
<li class="tsd-description">
|
|
630
|
+
<div class="tsd-comment tsd-typography"><p>Prepend any number of val arguments to the list. The
|
|
631
|
+
argument list is prepended as a block to reduce confusion:</p>
|
|
632
|
+
<pre><code class="language-javascript"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">4</span><span class="hl-1">).</span><span class="hl-0">prepend</span><span class="hl-1">(</span><span class="hl-5">0</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">); </span><span class="hl-8">// [0, 1, 2, 3, 4]</span>
|
|
633
|
+
</code><button>Copy</button></pre>
|
|
634
|
+
</div>
|
|
635
|
+
<div class="tsd-parameters">
|
|
636
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
637
|
+
<ul class="tsd-parameter-list">
|
|
638
|
+
<li>
|
|
639
|
+
<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span></h5>
|
|
640
|
+
<div class="tsd-comment tsd-typography"><p>Data to be stored in the node, accepts any number of arguments</p>
|
|
641
|
+
</div>
|
|
642
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
643
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
644
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
645
|
+
<ul>
|
|
646
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L298">src/data-structures/linked-list/singly-linked-list.ts:298</a></li></ul></aside></li></ul></section>
|
|
647
|
+
<section class="tsd-panel tsd-member"><a id="push" class="tsd-anchor"></a>
|
|
648
|
+
<h3 class="tsd-anchor-link"><span>push</span><a href="#push" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
649
|
+
<ul class="tsd-signatures">
|
|
650
|
+
<li class="tsd-signature tsd-anchor-link" id="push.push-1"><span class="tsd-kind-call-signature">push</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#push.push-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
651
|
+
<li class="tsd-description">
|
|
652
|
+
<div class="tsd-comment tsd-typography"><p>Synonym for append</p>
|
|
653
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">).</span><span class="hl-0">push</span><span class="hl-1">(</span><span class="hl-5">2</span><span class="hl-1">).</span><span class="hl-0">push</span><span class="hl-1">(</span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">4</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3 <=> 4</span>
|
|
654
|
+
</code><button>Copy</button></pre>
|
|
655
|
+
</div>
|
|
656
|
+
<div class="tsd-parameters">
|
|
657
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
658
|
+
<ul class="tsd-parameter-list">
|
|
659
|
+
<li>
|
|
660
|
+
<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span></h5>
|
|
661
|
+
<div class="tsd-comment tsd-typography"><p>Data to be stored, takes any number of arguments</p>
|
|
662
|
+
</div>
|
|
663
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
664
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
|
665
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
666
|
+
<ul>
|
|
667
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L285">src/data-structures/linked-list/singly-linked-list.ts:285</a></li></ul></aside></li></ul></section>
|
|
668
|
+
<section class="tsd-panel tsd-member"><a id="reduce" class="tsd-anchor"></a>
|
|
669
|
+
<h3 class="tsd-anchor-link"><span>reduce</span><a href="#reduce" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
670
|
+
<ul class="tsd-signatures">
|
|
671
|
+
<li class="tsd-signature tsd-anchor-link" id="reduce.reduce-1"><span class="tsd-kind-call-signature">reduce</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">f</span>, <span class="tsd-kind-parameter">start</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">reverse</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><a href="#reduce.reduce-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
672
|
+
<li class="tsd-description">
|
|
673
|
+
<div class="tsd-comment tsd-typography"><p>Reduce over each node in the list</p>
|
|
674
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">reduce</span><span class="hl-1">(</span><span class="hl-6">n</span><span class="hl-1"> </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-6">n</span><span class="hl-1"> += </span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">0</span><span class="hl-1">); </span><span class="hl-8">// 3</span>
|
|
675
|
+
</code><button>Copy</button></pre>
|
|
676
|
+
</div>
|
|
677
|
+
<div class="tsd-parameters">
|
|
678
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
679
|
+
<ul class="tsd-parameter-list">
|
|
680
|
+
<li>
|
|
681
|
+
<h5><span class="tsd-kind-parameter">f</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">accumulator</span>, <span class="tsd-kind-parameter">currentNode</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span></h5>
|
|
682
|
+
<div class="tsd-comment tsd-typography"><p>A reducer function</p>
|
|
683
|
+
</div>
|
|
684
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
685
|
+
<ul class="tsd-parameters">
|
|
686
|
+
<li class="tsd-parameter-signature">
|
|
687
|
+
<ul class="tsd-signatures">
|
|
688
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">accumulator</span>, <span class="tsd-kind-parameter">currentNode</span>, <span class="tsd-kind-parameter">index</span>, <span class="tsd-kind-parameter">list</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
|
|
689
|
+
<li class="tsd-description">
|
|
690
|
+
<div class="tsd-parameters">
|
|
691
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
692
|
+
<ul class="tsd-parameter-list">
|
|
693
|
+
<li>
|
|
694
|
+
<h5><span class="tsd-kind-parameter">accumulator</span>: <span class="tsd-signature-type">any</span></h5></li>
|
|
695
|
+
<li>
|
|
696
|
+
<h5><span class="tsd-kind-parameter">currentNode</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
697
|
+
<li>
|
|
698
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5></li>
|
|
699
|
+
<li>
|
|
700
|
+
<h5><span class="tsd-kind-parameter">list</span>: <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
701
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4></li></ul></li></ul></li>
|
|
702
|
+
<li>
|
|
703
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">start</span>: <span class="tsd-signature-type">any</span></h5>
|
|
704
|
+
<div class="tsd-comment tsd-typography"><p>An initial value</p>
|
|
705
|
+
</div>
|
|
706
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
707
|
+
<li>
|
|
708
|
+
<h5><span class="tsd-kind-parameter">reverse</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5></li></ul></div>
|
|
709
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><p>The final state of the accumulator</p>
|
|
710
|
+
|
|
711
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
712
|
+
<ul>
|
|
713
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L692">src/data-structures/linked-list/singly-linked-list.ts:692</a></li></ul></aside></li></ul></section>
|
|
714
|
+
<section class="tsd-panel tsd-member"><a id="removeAt" class="tsd-anchor"></a>
|
|
715
|
+
<h3 class="tsd-anchor-link"><span>remove<wbr/>At</span><a href="#removeAt" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
716
|
+
<ul class="tsd-signatures">
|
|
717
|
+
<li class="tsd-signature tsd-anchor-link" id="removeAt.removeAt-1"><span class="tsd-kind-call-signature">remove<wbr/>At</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">index</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#removeAt.removeAt-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
718
|
+
<li class="tsd-description">
|
|
719
|
+
<div class="tsd-comment tsd-typography"><p>Remove the node at the specified index</p>
|
|
720
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">removeAt</span><span class="hl-1">(</span><span class="hl-5">2</span><span class="hl-1">); </span><span class="hl-8">// { prev: null, val: 3, next: null, list: null }</span>
|
|
721
|
+
</code><button>Copy</button></pre>
|
|
722
|
+
</div>
|
|
723
|
+
<div class="tsd-parameters">
|
|
724
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
725
|
+
<ul class="tsd-parameter-list">
|
|
726
|
+
<li>
|
|
727
|
+
<h5><span class="tsd-kind-parameter">index</span>: <span class="tsd-signature-type">number</span></h5>
|
|
728
|
+
<div class="tsd-comment tsd-typography"><p>Index at which to remove</p>
|
|
729
|
+
</div>
|
|
730
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
731
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
732
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
733
|
+
<ul>
|
|
734
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L386">src/data-structures/linked-list/singly-linked-list.ts:386</a></li></ul></aside></li></ul></section>
|
|
735
|
+
<section class="tsd-panel tsd-member tsd-is-private"><a id="removeFromAnyEnd" class="tsd-anchor"></a>
|
|
736
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>remove<wbr/>From<wbr/>Any<wbr/>End</span><a href="#removeFromAnyEnd" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
737
|
+
<ul class="tsd-signatures tsd-is-private">
|
|
738
|
+
<li class="tsd-signature tsd-anchor-link" id="removeFromAnyEnd.removeFromAnyEnd-1"><span class="tsd-kind-call-signature">remove<wbr/>From<wbr/>Any<wbr/>End</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><a href="#removeFromAnyEnd.removeFromAnyEnd-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
739
|
+
<li class="tsd-description">
|
|
740
|
+
<div class="tsd-comment tsd-typography"><p>Private helper function to reduce duplication of pop() and shift() methods</p>
|
|
741
|
+
</div>
|
|
742
|
+
<div class="tsd-parameters">
|
|
743
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
744
|
+
<ul class="tsd-parameter-list">
|
|
745
|
+
<li>
|
|
746
|
+
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
747
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h4>
|
|
748
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
749
|
+
<ul>
|
|
750
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L764">src/data-structures/linked-list/singly-linked-list.ts:764</a></li></ul></aside></li></ul></section>
|
|
751
|
+
<section class="tsd-panel tsd-member"><a id="removeNode" class="tsd-anchor"></a>
|
|
752
|
+
<h3 class="tsd-anchor-link"><span>remove<wbr/>Node</span><a href="#removeNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
753
|
+
<ul class="tsd-signatures">
|
|
754
|
+
<li class="tsd-signature tsd-anchor-link" id="removeNode.removeNode-1"><span class="tsd-kind-call-signature">remove<wbr/>Node</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#removeNode.removeNode-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
755
|
+
<li class="tsd-description">
|
|
756
|
+
<div class="tsd-comment tsd-typography"><p>Remove the specified node from the list and return the removed
|
|
757
|
+
node afterwards.</p>
|
|
758
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">);</span><br/><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">removeNode</span><span class="hl-1">(</span><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-6">tail</span><span class="hl-1">); </span><span class="hl-8">// { prev: null, val: 3, next: null, list: null }</span>
|
|
759
|
+
</code><button>Copy</button></pre>
|
|
760
|
+
</div>
|
|
761
|
+
<div class="tsd-parameters">
|
|
762
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
763
|
+
<ul class="tsd-parameter-list">
|
|
764
|
+
<li>
|
|
765
|
+
<h5><span class="tsd-kind-parameter">node</span>: <a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h5>
|
|
766
|
+
<div class="tsd-comment tsd-typography"><p>The node to be removed</p>
|
|
767
|
+
</div>
|
|
768
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
769
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedListNode.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedListNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
770
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
771
|
+
<ul>
|
|
772
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L351">src/data-structures/linked-list/singly-linked-list.ts:351</a></li></ul></aside></li></ul></section>
|
|
773
|
+
<section class="tsd-panel tsd-member"><a id="reverse" class="tsd-anchor"></a>
|
|
774
|
+
<h3 class="tsd-anchor-link"><span>reverse</span><a href="#reverse" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
775
|
+
<ul class="tsd-signatures">
|
|
776
|
+
<li class="tsd-signature tsd-anchor-link" id="reverse.reverse-1"><span class="tsd-kind-call-signature">reverse</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#reverse.reverse-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
777
|
+
<li class="tsd-description">
|
|
778
|
+
<div class="tsd-comment tsd-typography"><p>The reverse() function reverses the list in place and returns the list
|
|
779
|
+
itself.</p>
|
|
780
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">reverse</span><span class="hl-1">(); </span><span class="hl-8">// 3 <=> 2 <=> 1</span>
|
|
781
|
+
</code><button>Copy</button></pre>
|
|
782
|
+
</div>
|
|
783
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
784
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
785
|
+
<ul>
|
|
786
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L601">src/data-structures/linked-list/singly-linked-list.ts:601</a></li></ul></aside></li></ul></section>
|
|
787
|
+
<section class="tsd-panel tsd-member"><a id="shift" class="tsd-anchor"></a>
|
|
788
|
+
<h3 class="tsd-anchor-link"><span>shift</span><a href="#shift" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
789
|
+
<ul class="tsd-signatures">
|
|
790
|
+
<li class="tsd-signature tsd-anchor-link" id="shift.shift-1"><span class="tsd-kind-call-signature">shift</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><a href="#shift.shift-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
791
|
+
<li class="tsd-description">
|
|
792
|
+
<div class="tsd-comment tsd-typography"><p>Remove the first node from the list and return the val of the removed node
|
|
793
|
+
or undefined</p>
|
|
794
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">shift</span><span class="hl-1">(); </span><span class="hl-8">// 1</span>
|
|
795
|
+
</code><button>Copy</button></pre>
|
|
796
|
+
</div>
|
|
797
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h4>
|
|
798
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
799
|
+
<ul>
|
|
800
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L507">src/data-structures/linked-list/singly-linked-list.ts:507</a></li></ul></aside></li></ul></section>
|
|
801
|
+
<section class="tsd-panel tsd-member"><a id="slice" class="tsd-anchor"></a>
|
|
802
|
+
<h3 class="tsd-anchor-link"><span>slice</span><a href="#slice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
803
|
+
<ul class="tsd-signatures">
|
|
804
|
+
<li class="tsd-signature tsd-anchor-link" id="slice.slice-1"><span class="tsd-kind-call-signature">slice</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">start</span>, <span class="tsd-kind-parameter">end</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#slice.slice-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
805
|
+
<li class="tsd-description">
|
|
806
|
+
<div class="tsd-comment tsd-typography"><p>The slice() method returns a shallow copy of a
|
|
807
|
+
portion of a list into a new list object selected
|
|
808
|
+
from start to end (end not included).
|
|
809
|
+
The original list will not be modified.</p>
|
|
810
|
+
<pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">, </span><span class="hl-5">4</span><span class="hl-1">, </span><span class="hl-5">5</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">newList</span><span class="hl-1"> = </span><span class="hl-6">list</span><span class="hl-1">.</span><span class="hl-0">slice</span><span class="hl-1">(</span><span class="hl-5">0</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">); </span><span class="hl-8">// 1 <=> 2 <=> 3</span>
|
|
811
|
+
</code><button>Copy</button></pre>
|
|
812
|
+
</div>
|
|
813
|
+
<div class="tsd-parameters">
|
|
814
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
815
|
+
<ul class="tsd-parameter-list">
|
|
816
|
+
<li>
|
|
817
|
+
<h5><span class="tsd-kind-parameter">start</span>: <span class="tsd-signature-type">number</span></h5>
|
|
818
|
+
<div class="tsd-comment tsd-typography"><p>Start index</p>
|
|
819
|
+
</div>
|
|
820
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
821
|
+
<li>
|
|
822
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">end</span>: <span class="tsd-signature-type">number</span></h5>
|
|
823
|
+
<div class="tsd-comment tsd-typography"><p>End index, optional</p>
|
|
824
|
+
</div>
|
|
825
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
826
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
827
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
828
|
+
<ul>
|
|
829
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L575">src/data-structures/linked-list/singly-linked-list.ts:575</a></li></ul></aside></li></ul></section>
|
|
830
|
+
<section class="tsd-panel tsd-member"><a id="sort" class="tsd-anchor"></a>
|
|
831
|
+
<h3 class="tsd-anchor-link"><span>sort</span><a href="#sort" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
832
|
+
<ul class="tsd-signatures">
|
|
833
|
+
<li class="tsd-signature tsd-anchor-link" id="sort.sort-1"><span class="tsd-kind-call-signature">sort</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">compare</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span><a href="#sort.sort-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
834
|
+
<li class="tsd-description">
|
|
835
|
+
<div class="tsd-comment tsd-typography"><p>Sorts the linked list using the provided compare function</p>
|
|
836
|
+
</div>
|
|
837
|
+
<div class="tsd-parameters">
|
|
838
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
839
|
+
<ul class="tsd-parameter-list">
|
|
840
|
+
<li>
|
|
841
|
+
<h5><span class="tsd-kind-parameter">compare</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span>, <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></h5>
|
|
842
|
+
<div class="tsd-comment tsd-typography"><p>A function used to compare the val of two nodes. It should return
|
|
843
|
+
a boolean. True will insert a before b, false will insert b before a.
|
|
844
|
+
(a, b) => a < b or (1, 2) => 1 < 2 === true, 2 will be inserted after 1,
|
|
845
|
+
the sort order will be ascending.</p>
|
|
846
|
+
</div>
|
|
847
|
+
<div class="tsd-comment tsd-typography"></div>
|
|
848
|
+
<ul class="tsd-parameters">
|
|
849
|
+
<li class="tsd-parameter-signature">
|
|
850
|
+
<ul class="tsd-signatures">
|
|
851
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span>, <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
|
|
852
|
+
<li class="tsd-description">
|
|
853
|
+
<div class="tsd-parameters">
|
|
854
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
855
|
+
<ul class="tsd-parameter-list">
|
|
856
|
+
<li>
|
|
857
|
+
<h5><span class="tsd-kind-parameter">a</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li>
|
|
858
|
+
<li>
|
|
859
|
+
<h5><span class="tsd-kind-parameter">b</span>: <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span></h5></li></ul></div>
|
|
860
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li></ul></div>
|
|
861
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">></span></h4>
|
|
862
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
863
|
+
<ul>
|
|
864
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L423">src/data-structures/linked-list/singly-linked-list.ts:423</a></li></ul></aside></li></ul></section>
|
|
865
|
+
<section class="tsd-panel tsd-member"><a id="toArray" class="tsd-anchor"></a>
|
|
866
|
+
<h3 class="tsd-anchor-link"><span>to<wbr/>Array</span><a href="#toArray" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
867
|
+
<ul class="tsd-signatures">
|
|
868
|
+
<li class="tsd-signature tsd-anchor-link" id="toArray.toArray-1"><span class="tsd-kind-call-signature">to<wbr/>Array</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span><a href="#toArray.toArray-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
869
|
+
<li class="tsd-description">
|
|
870
|
+
<div class="tsd-comment tsd-typography"><p>Convert the linked list to an array</p>
|
|
871
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">).</span><span class="hl-0">toArray</span><span class="hl-1">(); </span><span class="hl-8">// [1, 2, 3]</span>
|
|
872
|
+
</code><button>Copy</button></pre>
|
|
873
|
+
</div>
|
|
874
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">NodeData</span><span class="tsd-signature-symbol">[]</span></h4>
|
|
875
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
876
|
+
<ul>
|
|
877
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L732">src/data-structures/linked-list/singly-linked-list.ts:732</a></li></ul></aside></li></ul></section>
|
|
878
|
+
<section class="tsd-panel tsd-member"><a id="toString" class="tsd-anchor"></a>
|
|
879
|
+
<h3 class="tsd-anchor-link"><span>to<wbr/>String</span><a href="#toString" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
880
|
+
<ul class="tsd-signatures">
|
|
881
|
+
<li class="tsd-signature tsd-anchor-link" id="toString.toString-1"><span class="tsd-kind-call-signature">to<wbr/>String</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">separator</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#toString.toString-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
882
|
+
<li class="tsd-description">
|
|
883
|
+
<div class="tsd-comment tsd-typography"><p>Convert a linked list to string</p>
|
|
884
|
+
<pre><code class="language-ts"><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LinkedList</span><span class="hl-1">(</span><span class="hl-2">'one'</span><span class="hl-1">, </span><span class="hl-2">'two'</span><span class="hl-1">, </span><span class="hl-2">'three'</span><span class="hl-1">).</span><span class="hl-0">toString</span><span class="hl-1">(</span><span class="hl-2">' <=> '</span><span class="hl-1">) === </span><span class="hl-2">'one <=> two <=> three'</span><span class="hl-1">;</span>
|
|
885
|
+
</code><button>Copy</button></pre>
|
|
886
|
+
</div>
|
|
887
|
+
<div class="tsd-parameters">
|
|
888
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
889
|
+
<ul class="tsd-parameter-list">
|
|
890
|
+
<li>
|
|
891
|
+
<h5><span class="tsd-kind-parameter">separator</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ' '</span></h5>
|
|
892
|
+
<div class="tsd-comment tsd-typography"><p>Optional string to be placed in between val nodes, default is one space</p>
|
|
893
|
+
</div>
|
|
894
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
895
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
|
|
896
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
897
|
+
<ul>
|
|
898
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L743">src/data-structures/linked-list/singly-linked-list.ts:743</a></li></ul></aside></li></ul></section>
|
|
899
|
+
<section class="tsd-panel tsd-member"><a id="from" class="tsd-anchor"></a>
|
|
900
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>from</span><a href="#from" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
901
|
+
<ul class="tsd-signatures">
|
|
902
|
+
<li class="tsd-signature tsd-anchor-link" id="from.from-1"><span class="tsd-kind-call-signature">from</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">iterable</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">></span><a href="#from.from-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
903
|
+
<li class="tsd-description">
|
|
904
|
+
<div class="tsd-comment tsd-typography"><p>Convert any iterable to a new linked list</p>
|
|
905
|
+
<pre><code class="language-javascript"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">array</span><span class="hl-1"> = [</span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">3</span><span class="hl-1">];</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">list</span><span class="hl-1"> = </span><span class="hl-6">LinkedList</span><span class="hl-1">.</span><span class="hl-0">from</span><span class="hl-1">(</span><span class="hl-6">array</span><span class="hl-1">);</span>
|
|
906
|
+
</code><button>Copy</button></pre>
|
|
907
|
+
</div>
|
|
908
|
+
<section class="tsd-panel">
|
|
909
|
+
<h4>Type Parameters</h4>
|
|
910
|
+
<ul class="tsd-type-parameter-list">
|
|
911
|
+
<li>
|
|
912
|
+
<h4><span class="tsd-kind-type-parameter">T</span></h4></li></ul></section>
|
|
913
|
+
<div class="tsd-parameters">
|
|
914
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
915
|
+
<ul class="tsd-parameter-list">
|
|
916
|
+
<li>
|
|
917
|
+
<h5><span class="tsd-kind-parameter">iterable</span>: <span class="tsd-signature-type ">Iterable</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">></span></h5>
|
|
918
|
+
<div class="tsd-comment tsd-typography"><p>Any iterable datatype like Array or Map</p>
|
|
919
|
+
</div>
|
|
920
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
921
|
+
<h4 class="tsd-returns-title">Returns <a href="SinglyLinkedList.html" class="tsd-signature-type tsd-kind-class">SinglyLinkedList</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">></span></h4>
|
|
922
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
923
|
+
<ul>
|
|
924
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/c6e933a/src/data-structures/linked-list/singly-linked-list.ts#L130">src/data-structures/linked-list/singly-linked-list.ts:130</a></li></ul></aside></li></ul></section></section></div>
|
|
925
|
+
<div class="col-sidebar">
|
|
926
|
+
<div class="page-menu">
|
|
927
|
+
<div class="tsd-navigation settings">
|
|
928
|
+
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
929
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
|
|
930
|
+
<div class="tsd-accordion-details">
|
|
931
|
+
<div class="tsd-filter-visibility">
|
|
932
|
+
<h4 class="uppercase">Member Visibility</h4><form>
|
|
933
|
+
<ul id="tsd-filter-options">
|
|
934
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
935
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
936
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
937
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
938
|
+
<div class="tsd-theme-toggle">
|
|
939
|
+
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
940
|
+
<details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
|
|
941
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
|
|
942
|
+
<div class="tsd-accordion-details">
|
|
943
|
+
<ul>
|
|
944
|
+
<li><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a></li>
|
|
945
|
+
<li><a href="#head" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>head</span></a></li>
|
|
946
|
+
<li><a href="#size" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>size</span></a></li>
|
|
947
|
+
<li><a href="#tail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tail</span></a></li>
|
|
948
|
+
<li><a href="#length" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>length</span></a></li>
|
|
949
|
+
<li><a href="#_iterator_" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>[iterator]</span></a></li>
|
|
950
|
+
<li><a href="#append" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>append</span></a></li>
|
|
951
|
+
<li><a href="#clear" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>clear</span></a></li>
|
|
952
|
+
<li><a href="#filter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>filter</span></a></li>
|
|
953
|
+
<li><a href="#find" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find</span></a></li>
|
|
954
|
+
<li><a href="#findIndex" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Index</span></a></li>
|
|
955
|
+
<li><a href="#findNode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Node</span></a></li>
|
|
956
|
+
<li><a href="#findNodeIndex" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>find<wbr/>Node<wbr/>Index</span></a></li>
|
|
957
|
+
<li><a href="#forEach" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>for<wbr/>Each</span></a></li>
|
|
958
|
+
<li><a href="#get" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get</span></a></li>
|
|
959
|
+
<li><a href="#getNode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Node</span></a></li>
|
|
960
|
+
<li><a href="#insertAfter" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>After</span></a></li>
|
|
961
|
+
<li><a href="#insertAt" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>At</span></a></li>
|
|
962
|
+
<li><a href="#insertBefore" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>insert<wbr/>Before</span></a></li>
|
|
963
|
+
<li><a href="#map" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>map</span></a></li>
|
|
964
|
+
<li><a href="#merge" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>merge</span></a></li>
|
|
965
|
+
<li><a href="#pop" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>pop</span></a></li>
|
|
966
|
+
<li><a href="#prepend" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend</span></a></li>
|
|
967
|
+
<li><a href="#push" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>push</span></a></li>
|
|
968
|
+
<li><a href="#reduce" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>reduce</span></a></li>
|
|
969
|
+
<li><a href="#removeAt" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>At</span></a></li>
|
|
970
|
+
<li><a href="#removeFromAnyEnd" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>From<wbr/>Any<wbr/>End</span></a></li>
|
|
971
|
+
<li><a href="#removeNode" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Node</span></a></li>
|
|
972
|
+
<li><a href="#reverse" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>reverse</span></a></li>
|
|
973
|
+
<li><a href="#shift" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>shift</span></a></li>
|
|
974
|
+
<li><a href="#slice" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>slice</span></a></li>
|
|
975
|
+
<li><a href="#sort" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>sort</span></a></li>
|
|
976
|
+
<li><a href="#toArray" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>to<wbr/>Array</span></a></li>
|
|
977
|
+
<li><a href="#toString" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>to<wbr/>String</span></a></li>
|
|
978
|
+
<li><a href="#from" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>from</span></a></li></ul></div></details></div>
|
|
979
|
+
<div class="site-menu">
|
|
980
|
+
<nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>data-<wbr/>structure-<wbr/>typed</span></a>
|
|
981
|
+
<ul class="tsd-small-nested-navigation">
|
|
982
|
+
<li><a href="../enums/CP.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>CP</span></a></li>
|
|
983
|
+
<li><a href="../enums/FamilyPosition.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-8"></use></svg><span>Family<wbr/>Position</span></a></li>
|
|
984
|
+
<li><a href="../enums/LoopType.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-8"></use></svg><span>Loop<wbr/>Type</span></a></li>
|
|
985
|
+
<li><a href="AVLTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>AVLTree</span></a></li>
|
|
986
|
+
<li><a href="AVLTreeNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>AVLTree<wbr/>Node</span></a></li>
|
|
987
|
+
<li><a href="AaTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Aa<wbr/>Tree</span></a></li>
|
|
988
|
+
<li><a href="AbstractEdge.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Abstract<wbr/>Edge</span></a></li>
|
|
989
|
+
<li><a href="AbstractGraph.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Abstract<wbr/>Graph</span></a></li>
|
|
990
|
+
<li><a href="AbstractVertex.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Abstract<wbr/>Vertex</span></a></li>
|
|
991
|
+
<li><a href="ArrayDeque.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Array<wbr/>Deque</span></a></li>
|
|
992
|
+
<li><a href="BST.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>BST</span></a></li>
|
|
993
|
+
<li><a href="BSTNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>BSTNode</span></a></li>
|
|
994
|
+
<li><a href="BTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>BTree</span></a></li>
|
|
995
|
+
<li><a href="BinaryIndexedTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Binary<wbr/>Indexed<wbr/>Tree</span></a></li>
|
|
996
|
+
<li><a href="BinaryTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Binary<wbr/>Tree</span></a></li>
|
|
997
|
+
<li><a href="BinaryTreeNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Binary<wbr/>Tree<wbr/>Node</span></a></li>
|
|
998
|
+
<li><a href="Character.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Character</span></a></li>
|
|
999
|
+
<li><a href="CoordinateMap.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Coordinate<wbr/>Map</span></a></li>
|
|
1000
|
+
<li><a href="CoordinateSet.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Coordinate<wbr/>Set</span></a></li>
|
|
1001
|
+
<li><a href="Deque.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Deque</span></a></li>
|
|
1002
|
+
<li><a href="DirectedEdge.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Directed<wbr/>Edge</span></a></li>
|
|
1003
|
+
<li><a href="DirectedGraph.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Directed<wbr/>Graph</span></a></li>
|
|
1004
|
+
<li><a href="DirectedVertex.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Directed<wbr/>Vertex</span></a></li>
|
|
1005
|
+
<li><a href="DoublyLinkedList.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Doubly<wbr/>Linked<wbr/>List</span></a></li>
|
|
1006
|
+
<li><a href="DoublyLinkedListNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Doubly<wbr/>Linked<wbr/>List<wbr/>Node</span></a></li>
|
|
1007
|
+
<li><a href="Heap.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Heap</span></a></li>
|
|
1008
|
+
<li><a href="Matrix2D.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Matrix2D</span></a></li>
|
|
1009
|
+
<li><a href="MatrixNTI2D.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>MatrixNTI2D</span></a></li>
|
|
1010
|
+
<li><a href="MaxHeap.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Max<wbr/>Heap</span></a></li>
|
|
1011
|
+
<li><a href="MaxPriorityQueue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Max<wbr/>Priority<wbr/>Queue</span></a></li>
|
|
1012
|
+
<li><a href="MinHeap.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Min<wbr/>Heap</span></a></li>
|
|
1013
|
+
<li><a href="MinPriorityQueue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Min<wbr/>Priority<wbr/>Queue</span></a></li>
|
|
1014
|
+
<li><a href="Navigator.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Navigator</span></a></li>
|
|
1015
|
+
<li><a href="ObjectDeque.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Object<wbr/>Deque</span></a></li>
|
|
1016
|
+
<li><a href="PriorityQueue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Priority<wbr/>Queue</span></a></li>
|
|
1017
|
+
<li><a href="Queue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Queue</span></a></li>
|
|
1018
|
+
<li><a href="RBTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>RBTree</span></a></li>
|
|
1019
|
+
<li><a href="SegmentTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Segment<wbr/>Tree</span></a></li>
|
|
1020
|
+
<li><a href="SegmentTreeNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Segment<wbr/>Tree<wbr/>Node</span></a></li>
|
|
1021
|
+
<li><a href="SinglyLinkedList.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Singly<wbr/>Linked<wbr/>List</span></a></li>
|
|
1022
|
+
<li><a href="SinglyLinkedListNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Singly<wbr/>Linked<wbr/>List<wbr/>Node</span></a></li>
|
|
1023
|
+
<li><a href="SplayTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Splay<wbr/>Tree</span></a></li>
|
|
1024
|
+
<li><a href="Stack.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Stack</span></a></li>
|
|
1025
|
+
<li><a href="TreeMultiSet.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Tree<wbr/>Multi<wbr/>Set</span></a></li>
|
|
1026
|
+
<li><a href="Trie.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Trie</span></a></li>
|
|
1027
|
+
<li><a href="TrieNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Trie<wbr/>Node</span></a></li>
|
|
1028
|
+
<li><a href="TwoThreeTree.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Two<wbr/>Three<wbr/>Tree</span></a></li>
|
|
1029
|
+
<li><a href="UndirectedEdge.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Undirected<wbr/>Edge</span></a></li>
|
|
1030
|
+
<li><a href="UndirectedGraph.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Undirected<wbr/>Graph</span></a></li>
|
|
1031
|
+
<li><a href="UndirectedVertex.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Undirected<wbr/>Vertex</span></a></li>
|
|
1032
|
+
<li><a href="Vector2D.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Vector2D</span></a></li></ul></nav></div></div></div>
|
|
1033
|
+
<div class="tsd-generator">
|
|
1034
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
1035
|
+
<div class="overlay"></div></body></html>
|