data-structure-typed 1.47.3 → 1.47.5

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 (69) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/benchmark/report.html +2 -2
  3. package/benchmark/report.json +12 -18
  4. package/dist/cjs/data-structures/hash/hash-map.d.ts +3 -3
  5. package/dist/cjs/data-structures/hash/hash-map.js +10 -4
  6. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
  7. package/dist/cjs/data-structures/hash/hash-table.d.ts +9 -4
  8. package/dist/cjs/data-structures/hash/hash-table.js +50 -5
  9. package/dist/cjs/data-structures/hash/hash-table.js.map +1 -1
  10. package/dist/cjs/data-structures/heap/heap.d.ts +6 -1
  11. package/dist/cjs/data-structures/heap/heap.js +51 -9
  12. package/dist/cjs/data-structures/heap/heap.js.map +1 -1
  13. package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +56 -56
  14. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +117 -119
  15. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  16. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +36 -36
  17. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +58 -60
  18. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  19. package/dist/cjs/data-structures/queue/deque.d.ts +49 -49
  20. package/dist/cjs/data-structures/queue/deque.js +79 -72
  21. package/dist/cjs/data-structures/queue/deque.js.map +1 -1
  22. package/dist/cjs/data-structures/queue/queue.d.ts +45 -0
  23. package/dist/cjs/data-structures/queue/queue.js +77 -0
  24. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  25. package/dist/cjs/data-structures/stack/stack.d.ts +18 -5
  26. package/dist/cjs/data-structures/stack/stack.js +56 -7
  27. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  28. package/dist/cjs/data-structures/trie/trie.d.ts +5 -0
  29. package/dist/cjs/data-structures/trie/trie.js +47 -0
  30. package/dist/cjs/data-structures/trie/trie.js.map +1 -1
  31. package/dist/mjs/data-structures/hash/hash-map.d.ts +3 -3
  32. package/dist/mjs/data-structures/hash/hash-map.js +10 -4
  33. package/dist/mjs/data-structures/hash/hash-table.d.ts +9 -4
  34. package/dist/mjs/data-structures/hash/hash-table.js +50 -5
  35. package/dist/mjs/data-structures/heap/heap.d.ts +6 -1
  36. package/dist/mjs/data-structures/heap/heap.js +51 -9
  37. package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +56 -56
  38. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +117 -119
  39. package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +36 -36
  40. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +58 -60
  41. package/dist/mjs/data-structures/queue/deque.d.ts +49 -49
  42. package/dist/mjs/data-structures/queue/deque.js +79 -72
  43. package/dist/mjs/data-structures/queue/queue.d.ts +45 -0
  44. package/dist/mjs/data-structures/queue/queue.js +77 -0
  45. package/dist/mjs/data-structures/stack/stack.d.ts +18 -5
  46. package/dist/mjs/data-structures/stack/stack.js +56 -7
  47. package/dist/mjs/data-structures/trie/trie.d.ts +5 -0
  48. package/dist/mjs/data-structures/trie/trie.js +47 -0
  49. package/dist/umd/data-structure-typed.js +545 -276
  50. package/dist/umd/data-structure-typed.min.js +2 -2
  51. package/dist/umd/data-structure-typed.min.js.map +1 -1
  52. package/package.json +1 -1
  53. package/src/data-structures/hash/hash-map.ts +13 -7
  54. package/src/data-structures/hash/hash-table.ts +59 -9
  55. package/src/data-structures/heap/heap.ts +60 -9
  56. package/src/data-structures/linked-list/doubly-linked-list.ts +129 -129
  57. package/src/data-structures/linked-list/singly-linked-list.ts +65 -65
  58. package/src/data-structures/queue/deque.ts +84 -77
  59. package/src/data-structures/queue/queue.ts +84 -0
  60. package/src/data-structures/stack/stack.ts +64 -8
  61. package/src/data-structures/trie/trie.ts +53 -0
  62. package/test/integration/conversion.test.ts +0 -0
  63. package/test/performance/data-structures/heap/heap.test.ts +13 -4
  64. package/test/unit/data-structures/hash/hash-table.test.ts +58 -2
  65. package/test/unit/data-structures/heap/min-heap.test.ts +48 -0
  66. package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +2 -2
  67. package/test/unit/data-structures/queue/queue.test.ts +37 -0
  68. package/test/unit/data-structures/stack/stack.test.ts +55 -5
  69. package/test/unit/data-structures/trie/trie.test.ts +33 -0
@@ -345,42 +345,30 @@ export declare class SinglyLinkedList<E = any> {
345
345
  */
346
346
  countOccurrences(value: E): number;
347
347
  /**
348
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as it needs to reverse the pointers of each node.
349
- * Space Complexity: O(1) - Constant space.
348
+ * The function returns an iterator that iterates over the values of a linked list.
349
+ */
350
+ [Symbol.iterator](): Generator<E, void, unknown>;
351
+ /**
352
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
353
+ * Space Complexity: O(1)
350
354
  */
351
355
  /**
352
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as it needs to reverse the pointers of each node.
353
- * Space Complexity: O(1) - Constant space.
356
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
357
+ * Space Complexity: O(1)
354
358
  *
355
359
  * The `forEach` function iterates over each element in a linked list and applies a callback function to each element.
356
360
  * @param callback - The callback parameter is a function that takes two arguments: value and index. The value argument
357
361
  * represents the value of the current node in the linked list, and the index argument represents the index of the
358
362
  * current node in the linked list.
359
363
  */
360
- forEach(callback: (value: E, index: number) => void): void;
361
- /**
362
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
363
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
364
- */
365
- /**
366
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
367
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
368
- *
369
- * The `map` function takes a callback function and applies it to each element in the SinglyLinkedList, returning a new
370
- * SinglyLinkedList with the transformed values.
371
- * @param callback - The callback parameter is a function that takes a value of type E (the type of values stored in
372
- * the original SinglyLinkedList) and returns a value of type U (the type of values that will be stored in the mapped
373
- * SinglyLinkedList).
374
- * @returns The `map` function is returning a new instance of `SinglyLinkedList<U>` that contains the mapped values.
375
- */
376
- map<U>(callback: (value: E) => U): SinglyLinkedList<U>;
364
+ forEach(callback: (value: E, index: number, list: SinglyLinkedList<E>) => void): void;
377
365
  /**
378
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
379
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
366
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
367
+ * Space Complexity: O(n)
380
368
  */
381
369
  /**
382
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
383
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
370
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
371
+ * Space Complexity: O(n)
384
372
  *
385
373
  * The `filter` function iterates through a SinglyLinkedList and returns a new SinglyLinkedList containing only the
386
374
  * elements that satisfy the given callback function.
@@ -388,27 +376,39 @@ export declare class SinglyLinkedList<E = any> {
388
376
  * It is used to determine whether a value should be included in the filtered list or not.
389
377
  * @returns The filtered list, which is an instance of the SinglyLinkedList class.
390
378
  */
391
- filter(callback: (value: E) => boolean): SinglyLinkedList<E>;
379
+ filter(callback: (value: E, index: number, list: SinglyLinkedList<E>) => boolean): SinglyLinkedList<E>;
392
380
  /**
393
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
394
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
381
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
382
+ * Space Complexity: O(n)
395
383
  */
396
384
  /**
397
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
398
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
385
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
386
+ * Space Complexity: O(n)
387
+ *
388
+ * The `map` function takes a callback function and applies it to each element in the SinglyLinkedList, returning a new
389
+ * SinglyLinkedList with the transformed values.
390
+ * @param callback - The callback parameter is a function that takes a value of type E (the type of values stored in
391
+ * the original SinglyLinkedList) and returns a value of type T (the type of values that will be stored in the mapped
392
+ * SinglyLinkedList).
393
+ * @returns The `map` function is returning a new instance of `SinglyLinkedList<T>` that contains the mapped values.
394
+ */
395
+ map<T>(callback: (value: E, index: number, list: SinglyLinkedList<E>) => T): SinglyLinkedList<T>;
396
+ /**
397
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
398
+ * Space Complexity: O(n)
399
+ */
400
+ /**
401
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
402
+ * Space Complexity: O(n)
399
403
  *
400
404
  * The `reduce` function iterates over a linked list and applies a callback function to each element, accumulating a
401
405
  * single value.
402
406
  * @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `value`. It is
403
407
  * used to perform a specific operation on each element of the linked list.
404
- * @param {U} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
408
+ * @param {T} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
405
409
  * point for the reduction operation.
406
410
  * @returns The `reduce` method is returning the final value of the accumulator after iterating through all the
407
411
  * elements in the linked list.
408
412
  */
409
- reduce<U>(callback: (accumulator: U, value: E) => U, initialValue: U): U;
410
- /**
411
- * The function returns an iterator that iterates over the values of a linked list.
412
- */
413
- [Symbol.iterator](): Generator<E, void, unknown>;
413
+ reduce<T>(callback: (accumulator: T, value: E, index: number, list: SinglyLinkedList<E>) => T, initialValue: T): T;
414
414
  }
@@ -605,58 +605,42 @@ class SinglyLinkedList {
605
605
  return count;
606
606
  }
607
607
  /**
608
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as it needs to reverse the pointers of each node.
609
- * Space Complexity: O(1) - Constant space.
610
- */
611
- /**
612
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as it needs to reverse the pointers of each node.
613
- * Space Complexity: O(1) - Constant space.
614
- *
615
- * The `forEach` function iterates over each element in a linked list and applies a callback function to each element.
616
- * @param callback - The callback parameter is a function that takes two arguments: value and index. The value argument
617
- * represents the value of the current node in the linked list, and the index argument represents the index of the
618
- * current node in the linked list.
608
+ * The function returns an iterator that iterates over the values of a linked list.
619
609
  */
620
- forEach(callback) {
610
+ *[Symbol.iterator]() {
621
611
  let current = this.head;
622
- let index = 0;
623
612
  while (current) {
624
- callback(current.value, index);
613
+ yield current.value;
625
614
  current = current.next;
626
- index++;
627
615
  }
628
616
  }
629
617
  /**
630
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
631
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
618
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
619
+ * Space Complexity: O(1)
632
620
  */
633
621
  /**
634
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
635
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
622
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
623
+ * Space Complexity: O(1)
636
624
  *
637
- * The `map` function takes a callback function and applies it to each element in the SinglyLinkedList, returning a new
638
- * SinglyLinkedList with the transformed values.
639
- * @param callback - The callback parameter is a function that takes a value of type E (the type of values stored in
640
- * the original SinglyLinkedList) and returns a value of type U (the type of values that will be stored in the mapped
641
- * SinglyLinkedList).
642
- * @returns The `map` function is returning a new instance of `SinglyLinkedList<U>` that contains the mapped values.
625
+ * The `forEach` function iterates over each element in a linked list and applies a callback function to each element.
626
+ * @param callback - The callback parameter is a function that takes two arguments: value and index. The value argument
627
+ * represents the value of the current node in the linked list, and the index argument represents the index of the
628
+ * current node in the linked list.
643
629
  */
644
- map(callback) {
645
- const mappedList = new SinglyLinkedList();
646
- let current = this.head;
647
- while (current) {
648
- mappedList.push(callback(current.value));
649
- current = current.next;
630
+ forEach(callback) {
631
+ let index = 0;
632
+ for (const el of this) {
633
+ callback(el, index, this);
634
+ index++;
650
635
  }
651
- return mappedList;
652
636
  }
653
637
  /**
654
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
655
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
638
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
639
+ * Space Complexity: O(n)
656
640
  */
657
641
  /**
658
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
659
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
642
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
643
+ * Space Complexity: O(n)
660
644
  *
661
645
  * The `filter` function iterates through a SinglyLinkedList and returns a new SinglyLinkedList containing only the
662
646
  * elements that satisfy the given callback function.
@@ -666,51 +650,65 @@ class SinglyLinkedList {
666
650
  */
667
651
  filter(callback) {
668
652
  const filteredList = new SinglyLinkedList();
669
- let current = this.head;
670
- while (current) {
671
- if (callback(current.value)) {
672
- filteredList.push(current.value);
653
+ let index = 0;
654
+ for (const current of this) {
655
+ if (callback(current, index, this)) {
656
+ filteredList.push(current);
673
657
  }
674
- current = current.next;
658
+ index++;
675
659
  }
676
660
  return filteredList;
677
661
  }
678
662
  /**
679
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
680
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
663
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
664
+ * Space Complexity: O(n)
681
665
  */
682
666
  /**
683
- * Time Complexity: O(n) - Linear time, where n is the length of the list, as they need to traverse the entire list to apply the callback or reduce the list.
684
- * Space Complexity: O(n) - Linear space, as they create new nodes or arrays.
667
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
668
+ * Space Complexity: O(n)
669
+ *
670
+ * The `map` function takes a callback function and applies it to each element in the SinglyLinkedList, returning a new
671
+ * SinglyLinkedList with the transformed values.
672
+ * @param callback - The callback parameter is a function that takes a value of type E (the type of values stored in
673
+ * the original SinglyLinkedList) and returns a value of type T (the type of values that will be stored in the mapped
674
+ * SinglyLinkedList).
675
+ * @returns The `map` function is returning a new instance of `SinglyLinkedList<T>` that contains the mapped values.
676
+ */
677
+ map(callback) {
678
+ const mappedList = new SinglyLinkedList();
679
+ let index = 0;
680
+ for (const current of this) {
681
+ mappedList.push(callback(current, index, this));
682
+ index++;
683
+ }
684
+ return mappedList;
685
+ }
686
+ /**
687
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
688
+ * Space Complexity: O(n)
689
+ */
690
+ /**
691
+ * Time Complexity: O(n), where n is the number of elements in the linked list.
692
+ * Space Complexity: O(n)
685
693
  *
686
694
  * The `reduce` function iterates over a linked list and applies a callback function to each element, accumulating a
687
695
  * single value.
688
696
  * @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `value`. It is
689
697
  * used to perform a specific operation on each element of the linked list.
690
- * @param {U} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
698
+ * @param {T} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
691
699
  * point for the reduction operation.
692
700
  * @returns The `reduce` method is returning the final value of the accumulator after iterating through all the
693
701
  * elements in the linked list.
694
702
  */
695
703
  reduce(callback, initialValue) {
696
704
  let accumulator = initialValue;
697
- let current = this.head;
698
- while (current) {
699
- accumulator = callback(accumulator, current.value);
700
- current = current.next;
705
+ let index = 0;
706
+ for (const current of this) {
707
+ accumulator = callback(accumulator, current, index, this);
708
+ index++;
701
709
  }
702
710
  return accumulator;
703
711
  }
704
- /**
705
- * The function returns an iterator that iterates over the values of a linked list.
706
- */
707
- *[Symbol.iterator]() {
708
- let current = this.head;
709
- while (current) {
710
- yield current.value;
711
- current = current.next;
712
- }
713
- }
714
712
  }
715
713
  exports.SinglyLinkedList = SinglyLinkedList;
716
714
  //# sourceMappingURL=singly-linked-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"singly-linked-list.js","sourceRoot":"","sources":["../../../../src/data-structures/linked-list/singly-linked-list.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,oBAAoB;IAI/B;;;;OAIG;IACH,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAbD,oDAaC;AAED,MAAa,gBAAgB;IAC3B;;OAEG;IACH;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IAEH;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAS,CAAI,IAAS;QAC3B,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAK,CAAC;QACnD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;YACvB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED;;;OAGG;IAEH;;;;;;;OAOG;IACH,IAAI,CAAC,KAAQ;QACX,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,IAAK,CAAC,IAAI,GAAG,OAAO,C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MAAM,CAAI,QAAyC,EAAE,YAAe;QAClE,IAAI,WAAW,GAAG,YAAY,CAAC;QAC/B,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,OAAO,OAAO,EAAE;YACd,WAAW,GAAG,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;YACnD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;SACxB;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,CAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjB,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;QAExB,OAAO,OAAO,EAAE;YACd,MAAM,OAAO,CAAC,KAAK,CAAC;YACpB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;SACxB;IACH,CAAC;CACF;AAzvBD,4CAyvBC"}
1
+ {"version":3,"file":"singly-linked-list.js","sourceRoot":"","sources":["../../../../src/data-structures/linked-list/singly-linked-list.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,oBAAoB;IAI/B;;;;OAIG;IACH,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAbD,oDAaC;AAED,MAAa,gBAAgB;IAC3B;;OAEG;IACH;QACE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IAEH;;;;;;;;OAQG;IACH,MAAM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AAC;QAC/C,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;YAC1B,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE;gBAClC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC5B;YACD,KAAK,EAAE,CAAC;SACT;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;OAGG;IAEH;;;;;;;;;;OAUG;IACH,GAAG,CAAI,QAAmE;QACxE,MAAM,UAAU,GAAG,IAAI,gBAAgB,EAAK,CAAC;QAC7C,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;YAC1B,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;YAChD,KAAK,EAAE,CAAC;SACT;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;OAGG;IAEH;;;;;;;;;;;;OAYG;IACH,MAAM,CAAI,QAAmF,EAAE,YAAe;QAC5G,IAAI,WAAW,GAAG,YAAY,CAAC;QAC/B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;YAC1B,WAAW,GAAG,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;YAC1D,KAAK,EAAE,CAAC;SACT;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAzvBD,4CAyvBC"}
@@ -318,12 +318,14 @@ export declare class Deque<E> {
318
318
  * Time Complexity: O(n)
319
319
  * Space Complexity: O(1)
320
320
  *
321
- * The `forEach` function iterates over each element in a deque and applies a callback function to
322
- * each element.
323
- * @param callback - The callback parameter is a function that will be called for each element in the
324
- * deque. It takes three parameters:
321
+ * The `find` function iterates over the elements in a deque and returns the first element for which
322
+ * the callback function returns true, or undefined if no such element is found.
323
+ * @param callback - A function that takes three parameters: element, index, and deque. It should
324
+ * return a boolean value indicating whether the element satisfies a certain condition.
325
+ * @returns The method `find` returns the first element in the deque that satisfies the condition
326
+ * specified by the callback function. If no element satisfies the condition, it returns `undefined`.
325
327
  */
326
- forEach(callback: (element: E, index: number, deque: Deque<E>) => void): void;
328
+ find(callback: (element: E, index: number, deque: Deque<E>) => boolean): E | undefined;
327
329
  /**
328
330
  * Time Complexity: O(n)
329
331
  * Space Complexity: O(1)
@@ -332,14 +334,14 @@ export declare class Deque<E> {
332
334
  * Time Complexity: O(n)
333
335
  * Space Complexity: O(1)
334
336
  *
335
- * The `find` function iterates over the elements in a deque and returns the first element for which
336
- * the callback function returns true, or undefined if no such element is found.
337
- * @param callback - A function that takes three parameters: element, index, and deque. It should
338
- * return a boolean value indicating whether the element satisfies a certain condition.
339
- * @returns The method `find` returns the first element in the deque that satisfies the condition
340
- * specified by the callback function. If no element satisfies the condition, it returns `undefined`.
337
+ * The function "indexOf" returns the index of the first occurrence of a given element in an array,
338
+ * or -1 if the element is not found.
339
+ * @param {E} element - The "element" parameter represents the element that you want to find the
340
+ * index of in the data structure.
341
+ * @returns The indexOf function returns the index of the first occurrence of the specified element
342
+ * in the data structure. If the element is not found, it returns -1.
341
343
  */
342
- find(callback: (element: E, index: number, deque: Deque<E>) => boolean): E | undefined;
344
+ indexOf(element: E): number;
343
345
  /**
344
346
  * Time Complexity: O(n)
345
347
  * Space Complexity: O(n)
@@ -354,18 +356,30 @@ export declare class Deque<E> {
354
356
  toArray(): E[];
355
357
  /**
356
358
  * Time Complexity: O(n)
357
- * Space Complexity: O(n)
359
+ * Space Complexity: O(1)
358
360
  */
359
361
  /**
360
362
  * Time Complexity: O(n)
361
- * Space Complexity: O(n)
363
+ * Space Complexity: O(1)
362
364
  *
363
- * The `map` function takes a callback function and applies it to each element in the deque,
364
- * returning a new deque with the results.
365
- * @param callback - The `callback` parameter is a function that takes three arguments:
366
- * @returns The `map` method is returning a new `Deque` object with the transformed elements.
365
+ * The above function is an implementation of the iterator protocol in TypeScript, allowing the
366
+ * object to be iterated over using a for...of loop.
367
+ */
368
+ [Symbol.iterator](): Generator<E, void, unknown>;
369
+ /**
370
+ * Time Complexity: O(n)
371
+ * Space Complexity: O(1)
372
+ */
373
+ /**
374
+ * Time Complexity: O(n)
375
+ * Space Complexity: O(1)
376
+ *
377
+ * The `forEach` function iterates over each element in a deque and applies a callback function to
378
+ * each element.
379
+ * @param callback - The callback parameter is a function that will be called for each element in the
380
+ * deque. It takes three parameters:
367
381
  */
368
- map<T>(callback: (element: E, index: number, deque: Deque<E>) => T): Deque<T>;
382
+ forEach(callback: (element: E, index: number, deque: this) => void): void;
369
383
  /**
370
384
  * Time Complexity: O(n)
371
385
  * Space Complexity: O(n)
@@ -381,7 +395,21 @@ export declare class Deque<E> {
381
395
  * @returns The `filter` method is returning a new `Deque` object that contains only the elements
382
396
  * that satisfy the given `predicate` function.
383
397
  */
384
- filter(predicate: (element: E, index: number, deque: Deque<E>) => boolean): Deque<E>;
398
+ filter(predicate: (element: E, index: number, deque: this) => boolean): Deque<E>;
399
+ /**
400
+ * Time Complexity: O(n)
401
+ * Space Complexity: O(n)
402
+ */
403
+ /**
404
+ * Time Complexity: O(n)
405
+ * Space Complexity: O(n)
406
+ *
407
+ * The `map` function takes a callback function and applies it to each element in the deque,
408
+ * returning a new deque with the results.
409
+ * @param callback - The `callback` parameter is a function that takes three arguments:
410
+ * @returns The `map` method is returning a new `Deque` object with the transformed elements.
411
+ */
412
+ map<T>(callback: (element: E, index: number, deque: this) => T): Deque<T>;
385
413
  /**
386
414
  * Time Complexity: O(n)
387
415
  * Space Complexity: O(1)
@@ -399,35 +427,7 @@ export declare class Deque<E> {
399
427
  * @returns the final value of the accumulator after iterating over all elements in the deque and
400
428
  * applying the callback function to each element.
401
429
  */
402
- reduce<T>(callback: (accumulator: T, element: E, index: number, deque: Deque<E>) => T, initialValue: T): T;
403
- /**
404
- * Time Complexity: O(n)
405
- * Space Complexity: O(1)
406
- */
407
- /**
408
- * Time Complexity: O(n)
409
- * Space Complexity: O(1)
410
- *
411
- * The function "indexOf" returns the index of the first occurrence of a given element in an array,
412
- * or -1 if the element is not found.
413
- * @param {E} element - The "element" parameter represents the element that you want to find the
414
- * index of in the data structure.
415
- * @returns The indexOf function returns the index of the first occurrence of the specified element
416
- * in the data structure. If the element is not found, it returns -1.
417
- */
418
- indexOf(element: E): number;
419
- /**
420
- * Time Complexity: O(n)
421
- * Space Complexity: O(1)
422
- */
423
- /**
424
- * Time Complexity: O(n)
425
- * Space Complexity: O(1)
426
- *
427
- * The above function is an implementation of the iterator protocol in TypeScript, allowing the
428
- * object to be iterated over using a for...of loop.
429
- */
430
- [Symbol.iterator](): Generator<E, void, unknown>;
430
+ reduce<T>(callback: (accumulator: T, element: E, index: number, deque: this) => T, initialValue: T): T;
431
431
  /**
432
432
  * Time Complexity: O(n)
433
433
  * Space Complexity: O(n)