data-structure-typed 1.42.7 → 1.42.9

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +13 -13
  3. package/benchmark/report.html +12 -12
  4. package/benchmark/report.json +106 -106
  5. package/dist/cjs/src/data-structures/binary-tree/avl-tree.d.ts +88 -23
  6. package/dist/cjs/src/data-structures/binary-tree/avl-tree.js +88 -23
  7. package/dist/cjs/src/data-structures/binary-tree/avl-tree.js.map +1 -1
  8. package/dist/cjs/src/data-structures/binary-tree/binary-tree.d.ts +180 -74
  9. package/dist/cjs/src/data-structures/binary-tree/binary-tree.js +388 -201
  10. package/dist/cjs/src/data-structures/binary-tree/binary-tree.js.map +1 -1
  11. package/dist/cjs/src/data-structures/binary-tree/bst.d.ts +121 -66
  12. package/dist/cjs/src/data-structures/binary-tree/bst.js +121 -67
  13. package/dist/cjs/src/data-structures/binary-tree/bst.js.map +1 -1
  14. package/dist/cjs/src/data-structures/binary-tree/rb-tree.d.ts +72 -5
  15. package/dist/cjs/src/data-structures/binary-tree/rb-tree.js +95 -18
  16. package/dist/cjs/src/data-structures/binary-tree/rb-tree.js.map +1 -1
  17. package/dist/cjs/src/data-structures/binary-tree/tree-multimap.d.ts +82 -43
  18. package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js +82 -43
  19. package/dist/cjs/src/data-structures/binary-tree/tree-multimap.js.map +1 -1
  20. package/dist/cjs/src/data-structures/graph/abstract-graph.d.ts +139 -36
  21. package/dist/cjs/src/data-structures/graph/abstract-graph.js +147 -36
  22. package/dist/cjs/src/data-structures/graph/abstract-graph.js.map +1 -1
  23. package/dist/cjs/src/data-structures/graph/directed-graph.d.ts +126 -0
  24. package/dist/cjs/src/data-structures/graph/directed-graph.js +126 -0
  25. package/dist/cjs/src/data-structures/graph/directed-graph.js.map +1 -1
  26. package/dist/cjs/src/data-structures/graph/undirected-graph.d.ts +63 -0
  27. package/dist/cjs/src/data-structures/graph/undirected-graph.js +63 -0
  28. package/dist/cjs/src/data-structures/graph/undirected-graph.js.map +1 -1
  29. package/dist/cjs/src/data-structures/heap/heap.d.ts +175 -12
  30. package/dist/cjs/src/data-structures/heap/heap.js +175 -12
  31. package/dist/cjs/src/data-structures/heap/heap.js.map +1 -1
  32. package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.d.ts +203 -0
  33. package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.js +203 -0
  34. package/dist/cjs/src/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  35. package/dist/cjs/src/data-structures/linked-list/singly-linked-list.d.ts +182 -0
  36. package/dist/cjs/src/data-structures/linked-list/singly-linked-list.js +182 -0
  37. package/dist/cjs/src/data-structures/linked-list/singly-linked-list.js.map +1 -1
  38. package/dist/cjs/src/data-structures/linked-list/skip-linked-list.d.ts +64 -0
  39. package/dist/cjs/src/data-structures/linked-list/skip-linked-list.js +64 -0
  40. package/dist/cjs/src/data-structures/linked-list/skip-linked-list.js.map +1 -1
  41. package/dist/cjs/src/data-structures/queue/deque.d.ts +113 -3
  42. package/dist/cjs/src/data-structures/queue/deque.js +113 -3
  43. package/dist/cjs/src/data-structures/queue/deque.js.map +1 -1
  44. package/dist/cjs/src/data-structures/queue/queue.d.ts +87 -0
  45. package/dist/cjs/src/data-structures/queue/queue.js +87 -0
  46. package/dist/cjs/src/data-structures/queue/queue.js.map +1 -1
  47. package/dist/cjs/src/data-structures/stack/stack.d.ts +42 -0
  48. package/dist/cjs/src/data-structures/stack/stack.js +42 -0
  49. package/dist/cjs/src/data-structures/stack/stack.js.map +1 -1
  50. package/dist/cjs/src/data-structures/trie/trie.d.ts +76 -0
  51. package/dist/cjs/src/data-structures/trie/trie.js +76 -1
  52. package/dist/cjs/src/data-structures/trie/trie.js.map +1 -1
  53. package/dist/mjs/src/data-structures/binary-tree/avl-tree.d.ts +88 -23
  54. package/dist/mjs/src/data-structures/binary-tree/avl-tree.js +88 -23
  55. package/dist/mjs/src/data-structures/binary-tree/binary-tree.d.ts +180 -74
  56. package/dist/mjs/src/data-structures/binary-tree/binary-tree.js +388 -201
  57. package/dist/mjs/src/data-structures/binary-tree/bst.d.ts +121 -66
  58. package/dist/mjs/src/data-structures/binary-tree/bst.js +121 -67
  59. package/dist/mjs/src/data-structures/binary-tree/rb-tree.d.ts +72 -5
  60. package/dist/mjs/src/data-structures/binary-tree/rb-tree.js +95 -18
  61. package/dist/mjs/src/data-structures/binary-tree/tree-multimap.d.ts +82 -43
  62. package/dist/mjs/src/data-structures/binary-tree/tree-multimap.js +82 -43
  63. package/dist/mjs/src/data-structures/graph/abstract-graph.d.ts +139 -36
  64. package/dist/mjs/src/data-structures/graph/abstract-graph.js +147 -36
  65. package/dist/mjs/src/data-structures/graph/directed-graph.d.ts +126 -0
  66. package/dist/mjs/src/data-structures/graph/directed-graph.js +126 -0
  67. package/dist/mjs/src/data-structures/graph/undirected-graph.d.ts +63 -0
  68. package/dist/mjs/src/data-structures/graph/undirected-graph.js +63 -0
  69. package/dist/mjs/src/data-structures/heap/heap.d.ts +175 -12
  70. package/dist/mjs/src/data-structures/heap/heap.js +175 -12
  71. package/dist/mjs/src/data-structures/linked-list/doubly-linked-list.d.ts +203 -0
  72. package/dist/mjs/src/data-structures/linked-list/doubly-linked-list.js +203 -0
  73. package/dist/mjs/src/data-structures/linked-list/singly-linked-list.d.ts +182 -0
  74. package/dist/mjs/src/data-structures/linked-list/singly-linked-list.js +182 -0
  75. package/dist/mjs/src/data-structures/linked-list/skip-linked-list.d.ts +64 -0
  76. package/dist/mjs/src/data-structures/linked-list/skip-linked-list.js +64 -0
  77. package/dist/mjs/src/data-structures/queue/deque.d.ts +113 -3
  78. package/dist/mjs/src/data-structures/queue/deque.js +113 -3
  79. package/dist/mjs/src/data-structures/queue/queue.d.ts +87 -0
  80. package/dist/mjs/src/data-structures/queue/queue.js +87 -0
  81. package/dist/mjs/src/data-structures/stack/stack.d.ts +42 -0
  82. package/dist/mjs/src/data-structures/stack/stack.js +42 -0
  83. package/dist/mjs/src/data-structures/trie/trie.d.ts +76 -0
  84. package/dist/mjs/src/data-structures/trie/trie.js +76 -1
  85. package/dist/umd/data-structure-typed.min.js +1 -1
  86. package/dist/umd/data-structure-typed.min.js.map +1 -1
  87. package/package.json +1 -1
  88. package/src/data-structures/binary-tree/avl-tree.ts +97 -23
  89. package/src/data-structures/binary-tree/binary-tree.ts +419 -204
  90. package/src/data-structures/binary-tree/bst.ts +130 -68
  91. package/src/data-structures/binary-tree/rb-tree.ts +106 -19
  92. package/src/data-structures/binary-tree/tree-multimap.ts +88 -44
  93. package/src/data-structures/graph/abstract-graph.ts +133 -7
  94. package/src/data-structures/graph/directed-graph.ts +145 -1
  95. package/src/data-structures/graph/undirected-graph.ts +72 -0
  96. package/src/data-structures/heap/heap.ts +201 -12
  97. package/src/data-structures/linked-list/doubly-linked-list.ts +232 -0
  98. package/src/data-structures/linked-list/singly-linked-list.ts +208 -0
  99. package/src/data-structures/linked-list/skip-linked-list.ts +74 -0
  100. package/src/data-structures/queue/deque.ts +127 -3
  101. package/src/data-structures/queue/queue.ts +99 -0
  102. package/src/data-structures/stack/stack.ts +48 -0
  103. package/src/data-structures/trie/trie.ts +87 -4
  104. package/test/integration/index.html +24 -2
  105. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +19 -2
  106. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +0 -1
  107. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -1
@@ -77,6 +77,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
77
77
  return new UndirectedEdge(v1, v2, weight !== null && weight !== void 0 ? weight : 1, value);
78
78
  }
79
79
  /**
80
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
81
+ * Space Complexity: O(1)
82
+ */
83
+ /**
84
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
85
+ * Space Complexity: O(1)
86
+ *
80
87
  * The function `getEdge` returns the first edge that connects two vertices, or null if no such edge exists.
81
88
  * @param {VO | VertexKey | null} v1 - The parameter `v1` represents a vertex or vertex ID. It can be of type `VO` (vertex
82
89
  * object), `null`, or `VertexKey` (a string or number representing the ID of a vertex).
@@ -97,6 +104,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
97
104
  return edges ? edges[0] || null : null;
98
105
  }
99
106
  /**
107
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
108
+ * Space Complexity: O(1)
109
+ */
110
+ /**
111
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
112
+ * Space Complexity: O(1)
113
+ *
100
114
  * The function removes an edge between two vertices in a graph and returns the removed edge.
101
115
  * @param {VO | VertexKey} v1 - The parameter `v1` represents either a vertex object (`VO`) or a vertex ID (`VertexKey`).
102
116
  * @param {VO | VertexKey} v2 - VO | VertexKey - This parameter can be either a vertex object (VO) or a vertex ID
@@ -121,6 +135,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
121
135
  return removed;
122
136
  }
123
137
  /**
138
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
139
+ * Space Complexity: O(1)
140
+ */
141
+ /**
142
+ * Time Complexity: O(|E|), where |E| is the number of edges incident to the given vertex.
143
+ * Space Complexity: O(1)
144
+ *
124
145
  * The deleteEdge function removes an edge between two vertices in a graph.
125
146
  * @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
126
147
  * @returns The method is returning either the removed edge (of type EO) or null if the edge was not found.
@@ -129,6 +150,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
129
150
  return this.deleteEdgeBetween(edge.vertices[0], edge.vertices[1]);
130
151
  }
131
152
  /**
153
+ * Time Complexity: O(1)
154
+ * Space Complexity: O(1)
155
+ */
156
+ /**
157
+ * Time Complexity: O(1)
158
+ * Space Complexity: O(1)
159
+ *
132
160
  * The function `degreeOf` returns the degree of a vertex in a graph, which is the number of edges connected to that
133
161
  * vertex.
134
162
  * @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`.
@@ -146,6 +174,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
146
174
  }
147
175
  }
148
176
  /**
177
+ * Time Complexity: O(1)
178
+ * Space Complexity: O(1)
179
+ */
180
+ /**
181
+ * Time Complexity: O(1)
182
+ * Space Complexity: O(1)
183
+ *
149
184
  * The function returns the edges of a given vertex or vertex ID.
150
185
  * @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`. A `VertexKey` is a
151
186
  * unique identifier for a vertex in a graph, while `VO` represents the type of the vertex.
@@ -161,6 +196,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
161
196
  }
162
197
  }
163
198
  /**
199
+ * Time Complexity: O(|V| + |E|), where |V| is the number of vertices and |E| is the number of edges.
200
+ * Space Complexity: O(|E|)
201
+ */
202
+ /**
203
+ * Time Complexity: O(|V| + |E|), where |V| is the number of vertices and |E| is the number of edges.
204
+ * Space Complexity: O(|E|)
205
+ *
164
206
  * The function "edgeSet" returns an array of unique edges from a set of edges.
165
207
  * @returns The method `edgeSet()` returns an array of type `EO[]`.
166
208
  */
@@ -174,6 +216,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
174
216
  return [...edgeSet];
175
217
  }
176
218
  /**
219
+ * Time Complexity: O(|V| + |E|), where |V| is the number of vertices and |E| is the number of edges.
220
+ * Space Complexity: O(|E|)
221
+ */
222
+ /**
223
+ * Time Complexity: O(|V| + |E|), where |V| is the number of vertices and |E| is the number of edges.
224
+ * Space Complexity: O(|E|)
225
+ *
177
226
  * The function "getNeighbors" returns an array of neighboring vertices for a given vertex or vertex ID.
178
227
  * @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
179
228
  * (`VertexKey`).
@@ -194,6 +243,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
194
243
  return neighbors;
195
244
  }
196
245
  /**
246
+ * Time Complexity: O(1)
247
+ * Space Complexity: O(1)
248
+ */
249
+ /**
250
+ * Time Complexity: O(1)
251
+ * Space Complexity: O(1)
252
+ *
197
253
  * The function "getEndsOfEdge" returns the vertices at the ends of an edge if the edge exists in the graph, otherwise
198
254
  * it returns null.
199
255
  * @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
@@ -214,6 +270,13 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
214
270
  }
215
271
  }
216
272
  /**
273
+ * Time Complexity: O(1)
274
+ * Space Complexity: O(1)
275
+ */
276
+ /**
277
+ * Time Complexity: O(1)
278
+ * Space Complexity: O(1)
279
+ *
217
280
  * The function adds an edge to the graph by updating the adjacency list with the vertices of the edge.
218
281
  * @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
219
282
  * @returns a boolean value.
@@ -1 +1 @@
1
- {"version":3,"file":"undirected-graph.js","sourceRoot":"","sources":["../../../../../src/data-structures/graph/undirected-graph.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,uCAAwC;AACxC,qDAA6E;AAI7E,MAAa,gBAA0B,SAAQ,+BAAiB;IAC9D;;;;;;OAMG;IACH,YAAY,GAAc,EAAE,KAAS;QACnC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpB,CAAC;CACF;AAXD,4CAWC;AAED,MAAa,cAA2B,SAAQ,6BAAe;IAG7D;;;;;;;;;OASG;IACH,YAAY,EAAa,EAAE,EAAa,EAAE,MAAe,EAAE,KAAS;QAClE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;CACF;AAjBD,wCAiBC;AAED,MAAa,eAMX,SAAQ,8BAA2B;IAGnC;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,IAAI,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C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YACrD,OAAO,IAAI,CAAC;SACb;QACD,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,EAAE,IAAI,EAAE,EAAE;YACZ,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SACjB;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED;;;;OAIG;IACO,YAAY,CAAC,IAAQ;QAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC,IAAI,SAAS,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;YACrC,IAAI,SAAS,EAAE;gBACb,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACzC,IAAI,KAAK,EAAE;oBACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAClB;qBAAM;oBACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;iBACpC;aACF;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvND,0CAuNC"}
1
+ {"version":3,"file":"undirected-graph.js","sourceRoot":"","sources":["../../../../../src/data-structures/graph/undirected-graph.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,uCAAwC;AACxC,qDAA6E;AAI7E,MAAa,gBAA0B,SAAQ,+BAAiB;IAC9D;;;;;;OA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G,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC,IAAI,SAAS,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;YACrC,IAAI,SAAS,EAAE;gBACb,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACzC,IAAI,KAAK,EAAE;oBACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAClB;qBAAM;oBACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;iBACpC;aACF;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/RD,0CA+RC"}
@@ -33,21 +33,49 @@ export declare class Heap<E = any> {
33
33
  comparator: Comparator<E>;
34
34
  }): Heap<E>;
35
35
  /**
36
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
37
+ * Space Complexity: O(1)
38
+ */
39
+ /**
40
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
41
+ * Space Complexity: O(1)
42
+ *
36
43
  * Insert an element into the heap and maintain the heap properties.
37
44
  * @param element - The element to be inserted.
38
45
  */
39
46
  add(element: E): Heap<E>;
40
47
  /**
48
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
49
+ * Space Complexity: O(1)
50
+ */
51
+ /**
52
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
53
+ * Space Complexity: O(1)
54
+ *
41
55
  * Insert an element into the heap and maintain the heap properties.
42
56
  * @param element - The element to be inserted.
43
57
  */
44
58
  push(element: E): Heap<E>;
45
59
  /**
60
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
61
+ * Space Complexity: O(1)
62
+ */
63
+ /**
64
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
65
+ * Space Complexity: O(1)
66
+ *
46
67
  * Remove and return the top element (smallest or largest element) from the heap.
47
68
  * @returns The top element or undefined if the heap is empty.
48
69
  */
49
70
  poll(): E | undefined;
50
71
  /**
72
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
73
+ * Space Complexity: O(1)
74
+ */
75
+ /**
76
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
77
+ * Space Complexity: O(1)
78
+ *
51
79
  * Remove and return the top element (smallest or largest element) from the heap.
52
80
  * @returns The top element or undefined if the heap is empty.
53
81
  */
@@ -67,49 +95,116 @@ export declare class Heap<E = any> {
67
95
  */
68
96
  clear(): void;
69
97
  /**
98
+ * Time Complexity: O(n), where n is the number of elements in the nodes array.
99
+ * Space Complexity: O(n)
100
+ */
101
+ /**
102
+ * Time Complexity: O(n), where n is the number of elements in the nodes array.
103
+ * Space Complexity: O(n)
104
+ *
70
105
  * Clear and add nodes of the heap
71
106
  * @param nodes
72
107
  */
73
108
  refill(nodes: E[]): void;
74
109
  /**
110
+ * Time Complexity: O(n), where n is the number of nodes in the heap.
111
+ * Space Complexity: O(1)
112
+ */
113
+ /**
114
+ * Time Complexity: O(n), where n is the number of nodes in the heap.
115
+ * Space Complexity: O(1)
116
+ *
75
117
  * Use a comparison function to check whether a binary heap contains a specific element.
76
118
  * @param element - the element to check.
77
119
  * @returns Returns true if the specified element is contained; otherwise, returns false.
78
120
  */
79
121
  has(element: E): boolean;
80
122
  /**
123
+ * Time Complexity: O(n), where n is the number of nodes in the heap.
124
+ * Space Complexity: O(h), where h is the height of the heap.
125
+ */
126
+ /**
127
+ * Time Complexity: O(n), where n is the number of nodes in the heap.
128
+ * Space Complexity: O(h), where h is the height of the heap.
129
+ *
81
130
  * Depth-first search (DFS) method, different traversal orders can be selected。
82
131
  * @param order - Traverse order parameter: 'in' (in-order), 'pre' (pre-order) or 'post' (post-order).
83
132
  * @returns An array containing elements traversed in the specified order.
84
133
  */
85
134
  dfs(order: DFSOrderPattern): E[];
86
135
  /**
136
+ * Time Complexity: O(n)
137
+ * Space Complexity: O(n)
138
+ */
139
+ /**
140
+ * Time Complexity: O(n)
141
+ * Space Complexity: O(n)
142
+ *
87
143
  * Convert the heap to an array.
88
144
  * @returns An array containing the elements of the heap.
89
145
  */
90
146
  toArray(): E[];
147
+ /**
148
+ * Time Complexity: O(1)
149
+ * Space Complexity: O(1)
150
+ */
91
151
  getNodes(): E[];
92
152
  /**
153
+ * Time Complexity: O(n)
154
+ * Space Complexity: O(n)
155
+ */
156
+ /**
157
+ * Time Complexity: O(n)
158
+ * Space Complexity: O(n)
159
+ *
93
160
  * Clone the heap, creating a new heap with the same elements.
94
161
  * @returns A new Heap instance containing the same elements.
95
162
  */
96
163
  clone(): Heap<E>;
97
164
  /**
165
+ * Time Complexity: O(n log n)
166
+ * Space Complexity: O(n)
167
+ */
168
+ /**
169
+ * Time Complexity: O(n log n)
170
+ * Space Complexity: O(n)
171
+ *
98
172
  * Sort the elements in the heap and return them as an array.
99
173
  * @returns An array containing the elements sorted in ascending order.
100
174
  */
101
175
  sort(): E[];
102
176
  /**
177
+ * Time Complexity: O(log n)
178
+ * Space Complexity: O(1)
179
+ */
180
+ /**
181
+ * Time Complexity: O(log n)
182
+ * Space Complexity: O(1)
183
+ *
103
184
  * Float operation to maintain heap properties after adding an element.
104
185
  * @param index - The index of the newly added element.
105
186
  */
106
187
  protected bubbleUp(index: number): void;
107
188
  /**
189
+ * Time Complexity: O(log n)
190
+ * Space Complexity: O(1)
191
+ */
192
+ /**
193
+ * Time Complexity: O(log n)
194
+ * Space Complexity: O(1)
195
+ *
108
196
  * Sinking operation to maintain heap properties after removing the top element.
109
197
  * @param index - The index from which to start sinking.
110
198
  */
111
199
  protected sinkDown(index: number): void;
112
200
  /**
201
+ * Time Complexity: O(n)
202
+ * Space Complexity: O(1)
203
+ */
204
+ /**
205
+ * Time Complexity: O(n)
206
+ * Space Complexity: O(1)
207
+ *
113
208
  * Fix the entire heap to maintain heap properties.
114
209
  */
115
210
  protected fix(): void;
@@ -140,28 +235,52 @@ export declare class FibonacciHeap<E> {
140
235
  */
141
236
  clear(): void;
142
237
  /**
143
- * O(1) time operation.
238
+ * Time Complexity: O(1)
239
+ * Space Complexity: O(1)
240
+ */
241
+ /**
242
+ * Time Complexity: O(1)
243
+ * Space Complexity: O(1)
244
+ *
144
245
  * Insert an element into the heap and maintain the heap properties.
145
246
  * @param element
146
247
  * @returns {FibonacciHeap<E>} FibonacciHeap<E> - The heap itself.
147
248
  */
148
249
  add(element: E): FibonacciHeap<E>;
149
250
  /**
150
- * O(1) time operation.
251
+ * Time Complexity: O(1)
252
+ * Space Complexity: O(1)
253
+ */
254
+ /**
255
+ * Time Complexity: O(1)
256
+ * Space Complexity: O(1)
257
+ *
151
258
  * Insert an element into the heap and maintain the heap properties.
152
259
  * @param element
153
260
  * @returns {FibonacciHeap<E>} FibonacciHeap<E> - The heap itself.
154
261
  */
155
262
  push(element: E): FibonacciHeap<E>;
156
263
  /**
157
- * O(1) time operation.
264
+ * Time Complexity: O(1)
265
+ * Space Complexity: O(1)
266
+ */
267
+ /**
268
+ * Time Complexity: O(1)
269
+ * Space Complexity: O(1)
270
+ *
158
271
  * Peek at the top element of the heap without removing it.
159
272
  * @returns The top element or undefined if the heap is empty.
160
273
  * @protected
161
274
  */
162
275
  peek(): E | undefined;
163
276
  /**
164
- * O(1) time operation.
277
+ * Time Complexity: O(n), where n is the number of nodes in the linked list.
278
+ * Space Complexity: O(1)
279
+ */
280
+ /**
281
+ * Time Complexity: O(n), where n is the number of nodes in the linked list.
282
+ * Space Complexity: O(1)
283
+ *
165
284
  * Get the size (number of elements) of the heap.
166
285
  * @param {FibonacciHeapNode<E>} head - The head of the linked list.
167
286
  * @protected
@@ -169,26 +288,45 @@ export declare class FibonacciHeap<E> {
169
288
  */
170
289
  consumeLinkedList(head?: FibonacciHeapNode<E>): FibonacciHeapNode<E>[];
171
290
  /**
172
- * O(log n) time operation.
173
- * Remove and return the top element (smallest or largest element) from the heap.
291
+ * Time Complexity: O(1)
292
+ * Space Complexity: O(1)
293
+ *
174
294
  * @param parent
175
295
  * @param node
176
296
  */
177
297
  mergeWithChild(parent: FibonacciHeapNode<E>, node: FibonacciHeapNode<E>): void;
178
298
  /**
179
- * O(log n) time operation.
299
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
300
+ * Space Complexity: O(1)
301
+ */
302
+ /**
303
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
304
+ * Space Complexity: O(1)
305
+ *
180
306
  * Remove and return the top element (smallest or largest element) from the heap.
181
307
  * @returns The top element or undefined if the heap is empty.
182
308
  */
183
309
  poll(): E | undefined;
184
310
  /**
185
- * O(log n) time operation.
311
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
312
+ * Space Complexity: O(1)
313
+ */
314
+ /**
315
+ * Time Complexity: O(log n), where n is the number of nodes in the heap.
316
+ * Space Complexity: O(1)
317
+ *
186
318
  * Remove and return the top element (smallest or largest element) from the heap.
187
319
  * @returns The top element or undefined if the heap is empty.
188
320
  */
189
321
  pop(): E | undefined;
190
322
  /**
191
- * O(log n) time operation.
323
+ * Time Complexity: O(1)
324
+ * Space Complexity: O(1)
325
+ */
326
+ /**
327
+ * Time Complexity: O(1)
328
+ * Space Complexity: O(1)
329
+ *
192
330
  * merge two heaps. The heap that is merged will be cleared. The heap that is merged into will remain.
193
331
  * @param heapToMerge
194
332
  */
@@ -207,19 +345,38 @@ export declare class FibonacciHeap<E> {
207
345
  */
208
346
  protected createNode(element: E): FibonacciHeapNode<E>;
209
347
  /**
348
+ * Time Complexity: O(1)
349
+ * Space Complexity: O(1)
350
+ */
351
+ /**
352
+ * Time Complexity: O(1)
353
+ * Space Complexity: O(1)
354
+ *
210
355
  * Merge the given node with the root list.
211
356
  * @param node - The node to be merged.
212
357
  */
213
358
  protected mergeWithRoot(node: FibonacciHeapNode<E>): void;
214
359
  /**
215
- * O(log n) time operation.
360
+ * Time Complexity: O(1)
361
+ * Space Complexity: O(1)
362
+ */
363
+ /**
364
+ * Time Complexity: O(1)
365
+ * Space Complexity: O(1)
366
+ *.
216
367
  * Remove and return the top element (smallest or largest element) from the heap.
217
368
  * @param node - The node to be removed.
218
369
  * @protected
219
370
  */
220
371
  protected removeFromRoot(node: FibonacciHeapNode<E>): void;
221
372
  /**
222
- * O(log n) time operation.
373
+ * Time Complexity: O(1)
374
+ * Space Complexity: O(1)
375
+ */
376
+ /**
377
+ * Time Complexity: O(1)
378
+ * Space Complexity: O(1)
379
+ *
223
380
  * Remove and return the top element (smallest or largest element) from the heap.
224
381
  * @param y
225
382
  * @param x
@@ -227,7 +384,13 @@ export declare class FibonacciHeap<E> {
227
384
  */
228
385
  protected link(y: FibonacciHeapNode<E>, x: FibonacciHeapNode<E>): void;
229
386
  /**
230
- * O(log n) time operation.
387
+ * Time Complexity: O(n log n), where n is the number of nodes in the heap.
388
+ * Space Complexity: O(n)
389
+ */
390
+ /**
391
+ * Time Complexity: O(n log n), where n is the number of nodes in the heap.
392
+ * Space Complexity: O(n)
393
+ *
231
394
  * Remove and return the top element (smallest or largest element) from the heap.
232
395
  * @protected
233
396
  */