graph-typed 1.54.3 → 2.0.1

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 (70) hide show
  1. package/dist/data-structures/base/iterable-element-base.d.ts +14 -40
  2. package/dist/data-structures/base/iterable-element-base.js +14 -11
  3. package/dist/data-structures/base/linear-base.d.ts +277 -0
  4. package/dist/data-structures/base/linear-base.js +552 -0
  5. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +12 -8
  6. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +50 -37
  7. package/dist/data-structures/binary-tree/avl-tree.d.ts +64 -0
  8. package/dist/data-structures/binary-tree/avl-tree.js +64 -0
  9. package/dist/data-structures/binary-tree/binary-tree.js +5 -5
  10. package/dist/data-structures/binary-tree/bst.js +11 -11
  11. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +175 -14
  12. package/dist/data-structures/binary-tree/tree-multi-map.js +210 -40
  13. package/dist/data-structures/graph/abstract-graph.js +16 -16
  14. package/dist/data-structures/hash/hash-map.d.ts +46 -0
  15. package/dist/data-structures/hash/hash-map.js +46 -0
  16. package/dist/data-structures/heap/heap.d.ts +3 -11
  17. package/dist/data-structures/heap/heap.js +0 -10
  18. package/dist/data-structures/heap/max-heap.d.ts +2 -2
  19. package/dist/data-structures/heap/min-heap.d.ts +2 -2
  20. package/dist/data-structures/linked-list/doubly-linked-list.d.ts +65 -94
  21. package/dist/data-structures/linked-list/doubly-linked-list.js +131 -146
  22. package/dist/data-structures/linked-list/singly-linked-list.d.ts +145 -75
  23. package/dist/data-structures/linked-list/singly-linked-list.js +283 -169
  24. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
  25. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +2 -2
  26. package/dist/data-structures/priority-queue/priority-queue.d.ts +2 -2
  27. package/dist/data-structures/queue/deque.d.ts +130 -91
  28. package/dist/data-structures/queue/deque.js +269 -169
  29. package/dist/data-structures/queue/queue.d.ts +131 -40
  30. package/dist/data-structures/queue/queue.js +181 -50
  31. package/dist/data-structures/stack/stack.d.ts +124 -11
  32. package/dist/data-structures/stack/stack.js +121 -10
  33. package/dist/data-structures/trie/trie.d.ts +4 -3
  34. package/dist/data-structures/trie/trie.js +3 -0
  35. package/dist/types/data-structures/base/base.d.ts +9 -4
  36. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
  37. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -1
  38. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
  39. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +2 -2
  40. package/dist/types/data-structures/queue/deque.d.ts +2 -3
  41. package/dist/types/data-structures/queue/queue.d.ts +2 -2
  42. package/package.json +2 -2
  43. package/src/data-structures/base/iterable-element-base.ts +29 -20
  44. package/src/data-structures/base/linear-base.ts +649 -0
  45. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +51 -36
  46. package/src/data-structures/binary-tree/avl-tree.ts +64 -0
  47. package/src/data-structures/binary-tree/binary-tree.ts +5 -5
  48. package/src/data-structures/binary-tree/bst.ts +9 -9
  49. package/src/data-structures/binary-tree/tree-multi-map.ts +214 -40
  50. package/src/data-structures/graph/abstract-graph.ts +16 -16
  51. package/src/data-structures/hash/hash-map.ts +46 -0
  52. package/src/data-structures/heap/heap.ts +3 -14
  53. package/src/data-structures/heap/max-heap.ts +2 -2
  54. package/src/data-structures/heap/min-heap.ts +2 -2
  55. package/src/data-structures/linked-list/doubly-linked-list.ts +144 -160
  56. package/src/data-structures/linked-list/singly-linked-list.ts +307 -185
  57. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -5
  58. package/src/data-structures/priority-queue/min-priority-queue.ts +2 -5
  59. package/src/data-structures/priority-queue/priority-queue.ts +2 -2
  60. package/src/data-structures/queue/deque.ts +286 -183
  61. package/src/data-structures/queue/queue.ts +196 -63
  62. package/src/data-structures/stack/stack.ts +124 -18
  63. package/src/data-structures/trie/trie.ts +7 -3
  64. package/src/types/data-structures/base/base.ts +17 -8
  65. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
  66. package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -1
  67. package/src/types/data-structures/linked-list/doubly-linked-list.ts +2 -2
  68. package/src/types/data-structures/linked-list/singly-linked-list.ts +2 -2
  69. package/src/types/data-structures/queue/deque.ts +2 -3
  70. package/src/types/data-structures/queue/queue.ts +2 -2
@@ -64,10 +64,7 @@ export class MaxPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
64
64
  * @returns The `filter` method is returning a new `MaxPriorityQueue` object that contains the elements that pass
65
65
  * the filter condition specified by the `callback` function.
66
66
  */
67
- override filter(
68
- callback: ElementCallback<E, R, boolean, MaxPriorityQueue<E, R>>,
69
- thisArg?: any
70
- ): MaxPriorityQueue<E, R> {
67
+ override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): MaxPriorityQueue<E, R> {
71
68
  const filteredPriorityQueue = new MaxPriorityQueue<E, R>([], {
72
69
  toElementFn: this.toElementFn,
73
70
  comparator: this.comparator
@@ -104,7 +101,7 @@ export class MaxPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
104
101
  * @returns a new instance of the `MaxPriorityQueue` class with the mapped elements.
105
102
  */
106
103
  override map<EM, RM>(
107
- callback: ElementCallback<E, R, EM, MaxPriorityQueue<E, R>>,
104
+ callback: ElementCallback<E, R, EM>,
108
105
  comparator: Comparator<EM>,
109
106
  toElementFn?: (rawElement: RM) => EM,
110
107
  thisArg?: any
@@ -53,10 +53,7 @@ export class MinPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
53
53
  * @returns The `filter` method is returning a new `MinPriorityQueue` object that contains the elements that pass
54
54
  * the filter condition specified by the `callback` function.
55
55
  */
56
- override filter(
57
- callback: ElementCallback<E, R, boolean, MinPriorityQueue<E, R>>,
58
- thisArg?: any
59
- ): MinPriorityQueue<E, R> {
56
+ override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): MinPriorityQueue<E, R> {
60
57
  const filteredPriorityQueue = new MinPriorityQueue<E, R>([], {
61
58
  toElementFn: this.toElementFn,
62
59
  comparator: this.comparator
@@ -93,7 +90,7 @@ export class MinPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
93
90
  * @returns a new instance of the `MinPriorityQueue` class with the mapped elements.
94
91
  */
95
92
  override map<EM, RM>(
96
- callback: ElementCallback<E, R, EM, MinPriorityQueue<E, R>>,
93
+ callback: ElementCallback<E, R, EM>,
97
94
  comparator: Comparator<EM>,
98
95
  toElementFn?: (rawElement: RM) => EM,
99
96
  thisArg?: any
@@ -55,7 +55,7 @@ export class PriorityQueue<E = any, R = any> extends Heap<E, R> {
55
55
  * @returns The `filter` method is returning a new `PriorityQueue` object that contains the elements that pass
56
56
  * the filter condition specified by the `callback` function.
57
57
  */
58
- override filter(callback: ElementCallback<E, R, boolean, PriorityQueue<E, R>>, thisArg?: any): PriorityQueue<E, R> {
58
+ override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): PriorityQueue<E, R> {
59
59
  const filteredPriorityQueue = new PriorityQueue<E, R>([], {
60
60
  toElementFn: this.toElementFn,
61
61
  comparator: this.comparator
@@ -92,7 +92,7 @@ export class PriorityQueue<E = any, R = any> extends Heap<E, R> {
92
92
  * @returns a new instance of the `PriorityQueue` class with the mapped elements.
93
93
  */
94
94
  override map<EM, RM>(
95
- callback: ElementCallback<E, R, EM, PriorityQueue<E, R>>,
95
+ callback: ElementCallback<E, R, EM>,
96
96
  comparator: Comparator<EM>,
97
97
  toElementFn?: (rawElement: RM) => EM,
98
98
  thisArg?: any